A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Customizing Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Multiple commands w/ context menu registry entry?



 
 
Thread Tools Display Modes
  #1  
Old August 10th 09, 07:37 PM posted to microsoft.public.windowsxp.customize
Burma
external usenet poster
 
Posts: 3
Default Multiple commands w/ context menu registry entry?

I'm wondering if there is a way to execute multiple commands on a
right-click context menu item?

For example, for the .txt file type I have a right-click menu item named
"MyEdit". When I select that, I'd like the .txt file to open in both
notepad and another editor I use. Thanks
Ads
  #2  
Old August 10th 09, 11:59 PM posted to microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default Multiple commands w/ context menu registry entry?

Write a BATCH-file and place the commands in order - one after the other.

Then, add a (right-click menu) entry in the registry under :

[HKEY_CLASSES_ROOT\*\shell] - for files

[HKEY_CLASSES_ROOT\Directory\shell] - for folders

The entry should be in the format - first key (under shell) is the command's name
that appears on the menu.

This can be overridden by filling in the 'default' value just under it.

Then the second key under your command's key is always named "command" and the
default value under it should be set to point to your batch file.

Add the parameter "%1" after the path to the batch file, as this is a "replaceable"
parameter that passes the file (or folder) name on to the command-line.

If you look how other commands under the "shell" key are formatted you will get the
idea.

Do a search for "shell" (untick all but "keys" in the search box) and take a look for
yourself...

==

Cheers, Tim Meddick, Peckham, London. :-)




"Burma" wrote in message
...
I'm wondering if there is a way to execute multiple commands on a
right-click context menu item?

For example, for the .txt file type I have a right-click menu item named
"MyEdit". When I select that, I'd like the .txt file to open in both
notepad and another editor I use. Thanks



  #3  
Old August 10th 09, 11:59 PM posted to microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default Multiple commands w/ context menu registry entry?


Write a BATCH-file and place the commands in order - one after the other.

Then, add a (right-click menu) entry in the registry under :

[HKEY_CLASSES_ROOT\*\shell] - for files

[HKEY_CLASSES_ROOT\Directory\shell] - for folders

The entry should be in the format - first key (under shell) is the command's name
that appears on the menu.

This can be overridden by filling in the 'default' value just under it.

Then the second key under your command's key is always named "command" and the
default value under it should be set to point to your batch file.

Add the parameter "%1" after the path to the batch file, as this is a "replaceable"
parameter that passes the file (or folder) name on to the command-line.

If you look how other commands under the "shell" key are formatted you will get the
idea.

Do a search for "shell" (untick all but "keys" in the search box) and take a look for
yourself...

==

Cheers, Tim Meddick, Peckham, London. :-)




"Burma" wrote in message
...
I'm wondering if there is a way to execute multiple commands on a
right-click context menu item?

For example, for the .txt file type I have a right-click menu item named
"MyEdit". When I select that, I'd like the .txt file to open in both
notepad and another editor I use. Thanks



  #4  
Old August 11th 09, 12:39 AM posted to microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default Multiple commands w/ context menu registry entry?

BTW - your BATCH file should look something like the following, but replace
myeditor.exe for the name of your editor program (obviously) :

@echo off
start /b c:\windows\system32\notepad.exe %*
start /b c:\path\path\myeditor.exe %*


....be sure to include the %* parameter after the executable name.

Also, enclose in "quotes" the "%1" parameter after the path to the BATCH file in it's
registry entry.

==

Cheers, Tim Meddick, Peckham, London. :-)




"Tim Meddick" wrote in message
...

clipped



  #5  
Old August 11th 09, 12:39 AM posted to microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default Multiple commands w/ context menu registry entry?

BTW - your BATCH file should look something like the following, but replace
myeditor.exe for the name of your editor program (obviously) :

@echo off
start /b c:\windows\system32\notepad.exe %*
start /b c:\path\path\myeditor.exe %*


....be sure to include the %* parameter after the executable name.

Also, enclose in "quotes" the "%1" parameter after the path to the BATCH file in it's
registry entry.

==

Cheers, Tim Meddick, Peckham, London. :-)




"Tim Meddick" wrote in message
...

clipped



  #6  
Old October 30th 09, 03:27 PM posted to microsoft.public.windowsxp.customize
jsh02_nova
external usenet poster
 
Posts: 4
Default Multiple commands w/ context menu registry entry?

Tim,
What registry key value determines the 'default' Shell or ShellEx action
for a File Type? i.e.; 'Command Prompt Here' shell command when added becomes
default over 'Explore'.

v/r
  #7  
Old October 30th 09, 03:27 PM posted to microsoft.public.windowsxp.customize
jsh02_nova
external usenet poster
 
Posts: 4
Default Multiple commands w/ context menu registry entry?

Tim,
What registry key value determines the 'default' Shell or ShellEx action
for a File Type? i.e.; 'Command Prompt Here' shell command when added becomes
default over 'Explore'.

v/r
  #8  
Old October 31st 09, 12:36 PM posted to microsoft.public.windowsxp.customize
J. P. Gilliver (John)
external usenet poster
 
Posts: 5,291
Default Multiple commands w/ context menu registry entry?

In message ,
jsh02_nova writes:
Tim,
What registry key value determines the 'default' Shell or ShellEx action
for a File Type? i.e.; 'Command Prompt Here' shell command when added becomes
default over 'Explore'.

v/r


I hope someone else'll be along shortly to answer your question for File
Types (IIRR it's fairly near the top in regedit, with each filetype
extension having its own section - have a look at the existing ones).
However, Command Prompt Here and Explore are applied to folders
(directories), not file types, I think (left pane in Explorer).
--
J. P. Gilliver. UMRA: 1960/1985 MB++G.5AL-IS-P--Ch++(p)Ar@T0H+Sh0!:`)DNAf
** http://www.soft255.demon.co.uk/G6JPG-PC/JPGminPC.htm for ludicrously
outdated thoughts on PCs. **

The most wasted of all days is one without laughter. -e.e. cummings, poet
(1894-1962)
  #9  
Old October 31st 09, 12:36 PM posted to microsoft.public.windowsxp.customize
J. P. Gilliver (John)
external usenet poster
 
Posts: 5,291
Default Multiple commands w/ context menu registry entry?

In message ,
jsh02_nova writes:
Tim,
What registry key value determines the 'default' Shell or ShellEx action
for a File Type? i.e.; 'Command Prompt Here' shell command when added becomes
default over 'Explore'.

v/r


I hope someone else'll be along shortly to answer your question for File
Types (IIRR it's fairly near the top in regedit, with each filetype
extension having its own section - have a look at the existing ones).
However, Command Prompt Here and Explore are applied to folders
(directories), not file types, I think (left pane in Explorer).
--
J. P. Gilliver. UMRA: 1960/1985 MB++G.5AL-IS-P--Ch++(p)Ar@T0H+Sh0!:`)DNAf
** http://www.soft255.demon.co.uk/G6JPG-PC/JPGminPC.htm for ludicrously
outdated thoughts on PCs. **

The most wasted of all days is one without laughter. -e.e. cummings, poet
(1894-1962)
  #10  
Old October 31st 09, 08:58 PM posted to microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default Multiple commands w/ context menu registry entry?

What determines the default action in the registry (under
HKEY_CLASSES_ROOT\[FileType]\Shell).

It will default to the key under the [Shell] key named "open" first of all.

You can override this default behaviour by changing the normally blank VALUE under
the [Shell] key to determine what key you want to be the default (double-click)
action. But the one named "open" is the one normally executed by default.

If you can understand it, below is a reg-script to add "Open with DOS Editor" to text
files and makes THAT the default action for text files without altering the normal
default of [NotePad] but overriding it by using the "DefaultValue" under the
[Shell] key to override the default action (or action[s] - separated by commas).

If you use this script, to reverse it's effects just open "Folder Options" "File
Types" go to the [.txt] file entry, click on the "Advanced" button and delete the
entry: "Open with DOS Editor".


REGEDIT4

[HKEY_CLASSES_ROOT\txtfile\Shell]
@="dosedit,open"

[HKEY_CLASSES_ROOT\txtfile\Shell\dosedit]
@="Open with DOS Editor"

[HKEY_CLASSES_ROOT\txtfile\Shell\dosedit\command]
"C:\\WINDOWS\\system32\\edit.com \"%1\""



==

Cheers, Tim Meddick, Peckham, London. :-)




"jsh02_nova" wrote in message
...
Tim,
What registry key value determines the 'default' Shell or ShellEx action
for a File Type? i.e.; 'Command Prompt Here' shell command when added becomes
default over 'Explore'.

v/r


  #11  
Old October 31st 09, 08:58 PM posted to microsoft.public.windowsxp.customize
Tim Meddick
external usenet poster
 
Posts: 1,995
Default Multiple commands w/ context menu registry entry?


What determines the default action in the registry (under
HKEY_CLASSES_ROOT\[FileType]\Shell).

It will default to the key under the [Shell] key named "open" first of all.

You can override this default behaviour by changing the normally blank VALUE under
the [Shell] key to determine what key you want to be the default (double-click)
action. But the one named "open" is the one normally executed by default.

If you can understand it, below is a reg-script to add "Open with DOS Editor" to text
files and makes THAT the default action for text files without altering the normal
default of [NotePad] but overriding it by using the "DefaultValue" under the
[Shell] key to override the default action (or action[s] - separated by commas).

If you use this script, to reverse it's effects just open "Folder Options" "File
Types" go to the [.txt] file entry, click on the "Advanced" button and delete the
entry: "Open with DOS Editor".


REGEDIT4

[HKEY_CLASSES_ROOT\txtfile\Shell]
@="dosedit,open"

[HKEY_CLASSES_ROOT\txtfile\Shell\dosedit]
@="Open with DOS Editor"

[HKEY_CLASSES_ROOT\txtfile\Shell\dosedit\command]
"C:\\WINDOWS\\system32\\edit.com \"%1\""



==

Cheers, Tim Meddick, Peckham, London. :-)




"jsh02_nova" wrote in message
...
Tim,
What registry key value determines the 'default' Shell or ShellEx action
for a File Type? i.e.; 'Command Prompt Here' shell command when added becomes
default over 'Explore'.

v/r


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 03:37 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.