Question

I am trying to use Run as... on a .CMD file using the context menu in Explorer, but I can only do that on .exe files. It was possible in Windows 2000, but since I upgraded to Windows XP that option is not available. It is possible though to do it in a Command Prompt window so the service is enabled and started. Does anyone know how to enable that in the context menu?

Answer

To add the Run as... menu for .CMD files, use this REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\cmdfile\shell\runas\command]
@="\"%1\" %*"

To add the Run as... menu for .BAT files, use the following REG file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\batfile\shell\runas\command]
@="\"%1\" %*"

Copy the above contents to Notepad, and save the file with .REG extension (say, cmd_runas.reg). Right-click the .REG file and choose Merge.