Command Line Options
(Pro Version only)


HTML Shrinker Pro offers some command line options. This means that you can use HTML Shrinker from a DOS box or automate certain task with HTML Shrinker Pro by using a script.


For example, if you start a DOS box, switch to the HTML Shrinker folder and type in

htmlshrinker.exe -?

a dialog with the following explanations will appear:


Syntax:

htmlshrinker.exe [-r] [-x] [-a] [-f Path] [-g] [-b] [-d] [-c] [-i] [-o Path] [-s]
[-e] [-?] [Path] [Path] [Path] ...

Switches:

-r restores the files (overrides shrinking).
-x removes the backup files (overrides shrinking or restoring).

-a includes all sub folders when shrinking, restoring or removing backups
-f Path  sets a special folder for placing or retrieving the backups.
-g saves the shrunken files (and not the backups) to the folder specified with "-f".
-b omits creating backups when shrinking and omits deleting the backups when restoring.

-d suppresses the dialog of HTML Shrinker (during processing).
-c activates the confirmation messages.
-i displays the Shrink dialog
before shrinking the files with the effect that the -b and -g switches will be ignored
(Please notice: If the "Suppress the Backup dialogs" check box is activated in the Options dialog, the Shrink dialog won't be displayed)

-o Path  opens the specified HSO file and activates the shrinking settings that are stored in the HSO file before shrinking the file
(Commercial Pro Version only).

-s simulates shrinking without saving the shrunken files.
-e displays the HTML Shrinker dialog after the command line parameters were processed.
-? shows this information dialog.

Path Parameter(s):

Can be paths to a folder or file.

 

 

Examples

Here are some examples that will illustrate the use of the command line instructions.


1. To shrink your web site (which doesn't contain any relevant sub folders) located at c:\html\mywebsite\ and to backup the original files in the same folder enter:

htmlshrinker.exe c:\html\mywebsite\


2. To shrink your web site (including all sub folders) located at c:\html\mywebsite\ and to backup the original files in the same folder enter:

htmlshrinker.exe -a c:\html\mywebsite\


3. To shrink your web site (including all sub folders) located at c:\html\mywebsite\ with the shrinking options from an options file (Commercial Pro Version only) that you saved before and to backup the original files in the same folder enter:

htmlshrinker.exe -a -o c:\html\mywebsite.hso c:\html\mywebsite\


4. To restore your web site to its original state enter:

htmlshrinker.exe -r -a c:\html\mywebsite\


5. To shrink your two web sites (including all sub folders) located at c:\html\mywebsite\ and c:\html\mywebsite2\ enter:

htmlshrinker.exe -a c:\html\mywebsite\ c:\html\mywebsite2\


6. To shrink the file index.html of your web site enter:

htmlshrinker.exe c:\html\mywebsite\index.html


7. To restore the same file enter:

htmlshrinker.exe -r c:\html\mywebsite\index.html


8. To remove all backup files which are located in the same folder as your web site (after you inspected all files and found no problems) enter:

htmlshrinker.exe -x -a c:\html\mywebsite\


9. To shrink your web site (including all sub folders) and to backup the original files to c:\backup\mywebsite\ enter:

htmlshrinker.exe -a -f c:\backup\mywebsite\ c:\html\mywebsite\


10. To restore your web site with backups located at c:\backup\mywebsite\ enter:

htmlshrinker.exe -r -a -f c:\backup\mywebsite\ c:\html\mywebsite\


11. To shrink your web site (including all sub folders) while leaving the original files untouched and saving the shrunken files to c:\upload\mywebsite\ enter:

htmlshrinker.exe -a -f c:\upload\mywebsite\ -g c:\html\mywebsite\


12. If you want to see how much smaller your web site would become when using HTML Shrinker, but don't want to already shrink it, you can use the -s switch to simulate shrinking. E.g.

htmlshrinker.exe -a -s c:\html\mywebsite\


 

 

Back to Main