Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 01-04-2007, 03:58 AM
Helge V. Larsen
Newsgroup Contributor
 
Posts: n/a
How to add a new item to the context menu of folders

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 ?



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 01-04-2007, 03:58 AM
  #2 (permalink)  
Old 01-04-2007, 03:58 AM
Ramesh, MS-MVP
Newsgroup Contributor
 
Posts: n/a
Re: How to add a new item to the context menu of folders

Hi,

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


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


"Helge V. Larsen" <Helge.V.Larsen_Remove_this@Risoe_Remove_this.DK > wrote in
message news:OUup0pABHHA.4680@TK2MSFTNGP04.phx.gbl...
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 ?




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 01-04-2007, 04:14 AM
NewScience
Newsgroup Contributor
 
Posts: n/a
Re: How to add a new item to the context menu of folders

How about:

@="notepad.exe" "%L\ReadMe.txt"

"Helge V. Larsen" <Helge.V.Larsen_Remove_this@Risoe_Remove_this.DK > wrote in
message news:OUup0pABHHA.4680@TK2MSFTNGP04.phx.gbl...
> 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 ?
>
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 01-04-2007, 04:14 AM
NewScience
Newsgroup Contributor
 
Posts: n/a
Re: How to add a new item to the context menu of folders

How about:

@="notepad.exe" "%L\ReadMe.txt"

"Helge V. Larsen" <Helge.V.Larsen_Remove_this@Risoe_Remove_this.DK > wrote in
message news:OUup0pABHHA.4680@TK2MSFTNGP04.phx.gbl...
> 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 ?
>
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: 'Run as administrator' Context Menu Item Richard G. Harper Windows Vista 0 05-26-2008 03:10 AM
Context Menu Item Ryan Windows Vista 0 01-23-2008 11:40 AM
how to remove the manage item from my computer's context menu? ILiya Windows XP 2 12-19-2007 04:30 AM
Context menu item problem in Vista Daze N. Knights Windows Vista 3 01-09-2007 10:45 AM
How do I create a new context menu item for files in Windows Explo Bizily Windows XP 2 01-05-2007 07:45 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 04:41 AM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0