ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Finished Programs

DONE: tiny right-click shell extension for Sysinternals' Contig (defrag)

<< < (2/2)

Edvard:
Okay, open Regedit
Go to HKCU/*
If there is not a key named "Shell" there, make one.
Inside "shell" make a key named "contig" and modifiy it's value to "Defrag with Contig"
Inside "contig" make a key named "command" and modify it's value to "path/to/contig" "%1"
(include quotes and spaces, and replace path/to... with YOUR path to your copy of Contig)
That will put it in your context menu for files. Now for folders...
Go to HKCU/Folder/shell and do the same except under "command" modify it's value to "path/to/contig -s" "%1\*.*"

OR

copy/paste this into a .reg file and Merge:
(just make sure you edit it to use YOUR path to contig.exe if this is not the same, and omit or edit the folder bit. I have written it to defrag the folder contents and recurse to subdirectories)

--- ---REGEDIT4

[HKEY_CLASSES_ROOT\*\shell\contig]
@="Defrag with Contig"

[HKEY_CLASSES_ROOT\*\shell\contig\command]
@="\"C:\\Program Files\\SysInternals\\Contig\\Contig.exe\" \"%1\""

[HKEY_CLASSES_ROOT\Folder\shell\contig]
@="Defrag with Contig"

[HKEY_CLASSES_ROOT\Folder\shell\contig\command]
@="\"C:\\Program Files\\SysInternals\\Contig\\Contig.exe -s\" \"%1\\*.*\""

One could even make an AutoHotkey script that would install/uninstall, but that may be going a bit too far...

brotherS:
Thanks, both of you!

I'm now using AutoHotkey to do the complete job. This script defrags the file and shows the result in your standard editor:


--- ---;2006-02-23
;defrag with Sysinternals' Contig http://www.sysinternals.com/Utilities/Contig.html
:*b0:.defrag::
InputBox, Defragpath, Defrag, enter full path of the file to defrag, ,420, 118
RunWait, %comspec% /c Contig -q "%Defragpath%" > summary.txt, C:\Programme\Contig Defrag\
Run, C:\Programme\Contig Defrag\summary.txt
return

Navigation

[0] Message Index

[*] Previous page

Go to full version