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

  • Thread starter Thread starter Helge V. Larsen
  • Start date Start date
H

Helge V. Larsen

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 "" 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 ?
 
Hi,

Use:

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

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

--
Regards,

Ramesh Srinivasan, Microsoft MVP [Windows XP Shell/User]
Windows® XP Troubleshooting http://www.winhelponline.com


message 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 "" 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 ?
 
Back
Top