It is possible to perform Absolute HTML Compressor commands from the command line. Common command line syntax is described below:
ahc Path -<switch1> -<switchN>
Path - the name of the folder or file to process. If the path includes
spaces use quotes to delimit it.
Switches are used to define various options of the optimization. Switches
entered on the command line override the same configuration settings.
You can use the following switches:
-m<Mask> - use the specified mask. If the mask includes spaces use quotes to delimit it.
The following switches are boolean ones. They define if the option is ON
or OFF. If you write -s or -s+ where s is name of the switch,
the appropriate option is ON. If you write -s- the appropriate option
is OFF. If you don't specify the option in the command line configuration settings
of the program are used.
-y | optimize without asking confirmation |
-s | process subfolders |
-l | merge lines |
-w | remove unnecessary whitespace characters |
-q | remove unnecessary quotation marks |
-t | replace some tags with the short ones |
-c | remove HTML comments |
-d | remove <!DOCTYPE...> tags |
-m | remove meta tags |
-b | create backups |
-a<Meta tags> - specify meta tags to remove (if -m option is ON). If the string includes spaces use quotes to delimit it.
Example:
ahc "c:\My Documents\html" -m"*.htm; *.html" -y -s- -b-