Use Run as... on a .cmd-file

M

Martin

Hello

I am trying to use Run as... on a .cmd file using the context menu in
Explorer (right-click on the .cmd-file) 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
DOS-window so the service is enabled and started. Does anyone know how
to enable that in the context menu?

Best regards

Martin
 
R

Ramesh, MS-MVP

Hi Martin,

I have no clue why the runas verb for cmd files was removed in XP. But, the following REG file can add it for you.

- - -
Windows Registry Editor Version 5.00

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

- - -

Copy the contents to Notepad, and save as runas-cmd.reg. Right-click the file and then choose Merge.

--
Regards,

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


Hello

I am trying to use Run as... on a .cmd file using the context menu in
Explorer (right-click on the .cmd-file) 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
DOS-window so the service is enabled and started. Does anyone know how
to enable that in the context menu?

Best regards

Martin
 
M

Martin

Yes! That worked out perfectly.

I also added Run as-support for files with bat extension so my reg-file
looks like this:

---
Windows Registry Editor Version 5.00

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

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

Thank you for the help

Best regards

Martin
 
R

Ramesh, MS-MVP

You're welcome, Martin.

--
Regards,

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


Yes! That worked out perfectly.

I also added Run as-support for files with bat extension so my reg-file
looks like this:

---
Windows Registry Editor Version 5.00

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

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

Thank you for the help

Best regards

Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top