Add a Send To for Sysinternals Contig

One of my favorite tools is Sysinternals’ (Microsoft) Contig commandline utility to make files contiguous. However, it’s a pain having to type the full path to the file or directory you want to contig, so I fooled around until I came up with these two tricks:

To create a Send To item that will contig a single file navigate to C:\Documents and Settings\your username\SendTo, right click & select New, Shortcut and use the wizard to locate the full path to contig.exe.

After you’ve finished, right click the shortcut and rename it to something that makes sense to you – I used “Contig File”. Right click on the shortcut again, select Properties and in the Target box add a space and "%cd%"\ It’ll windup looking something like c:\sysinternals\contig "%cd%"\ Click Apply and OK. Now you can right click on any file in Explorer and a DOS window will open up and Contig will contig your file and close the DOS window.

To create a Send To item that will contig a directory recursively follow the same steps above (copy and rename the Contig File shortcut) except change the Target line to space -s space "%cd%"\ so it looks like c:\sysinternals\contig -s "%cd%"\

The trick here is using “%cd%”. %cd% is the full path to the current working directory where the file (or directory) you want to contig is located. The “” convert the Long File Name from the %cd% into something DOS understands.


2 Responses to “Add a Send To for Sysinternals Contig”

  1. Looks like you are using a “left double quote” and then a “right double quote”.

    Where is the “left double quote” on a keyboard?

    Also, the DOS window just instantly opens/closes when I pick my “send to contig” menu.

  2. @Paula I changed the text in the article so the code looks like code. WordPress turned double quotes into left and right double quotes – you want to use plain old double quotes.

    Contig is pretty fast, but not instant so I’ll bet the quote problem made it not work right.

Leave a Reply