Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add a new item to the context menu of folders

Status
Not open for further replies.

HelgeLarsen

Programmer
Mar 18, 2004
16
DK
The following registry extension will add the item "Dir /S" to the folder context menu.
By selecting this item the command file (DOS batch file) "C:\BAT\_DirS.cmd" is executed.

[HKEY_CLASSES_ROOT\Directory\shell\CMD1]
@="Dir /S"

[HKEY_CLASSES_ROOT\Directory\shell\CMD1\Command]
@="C:\\BAT\\_DirS.cmd"

In the same way the following registry extension will add the item "Create _ReadMe.txt" to the folder context menu.
But the script file "C:\BAT\_ReadMe.vbs" will NOT run when I select "Create _ReadMe.txt" in the folder menu.

[HKEY_CLASSES_ROOT\Directory\shell\CMD2]
@="Create _ReadMe.txt"

[HKEY_CLASSES_ROOT\Directory\shell\CMD2\Command]
@="C:\\BAT\\_ReadMe.vbs"

How can I change it so that a script file can be executed ?

Is the trick that "Command" in "...\CMD2\Command" should be replaced by something else ?



________________________
Helge Larsen
 
If it s VBS script you can just add it in the File types dialog box from explorer. as it will automatically run.

Including it in the shell command does nothing because its not a shell command/DOS.

Open windows Explorer, select Tools->Folder Options, File Types, click on the "Folder" or "File Folder" type, and select advanced then add an action and point it to your VBS script.





----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top