Computer Hope

Microsoft => Microsoft DOS => Topic started by: mioo_sara on May 27, 2009, 05:20:32 AM

Title: add a .bat file to right click contents menu
Post by: mioo_sara on May 27, 2009, 05:20:32 AM
add a .bat file to  right click  contents menu
=======================================
hi
is there a way to  add a .bat file to  right click  contents menu?
if its so  give me the exact  string for .reg file
thanks
Title: Re: add a .bat file to right click contents menu
Post by: Carbon Dudeoxide on May 27, 2009, 05:35:44 AM
Not sure what you mean. What Right Click menu? What would its purpose be?
Title: Re: add a .bat file to right click contents menu
Post by: macdad- on May 27, 2009, 08:04:01 AM
I believe he means on the "New" Item under the File menu, he wants to add a Create new Batch File:


View this:
http://windowsxp.mvps.org/shellnewadd.htm (http://windowsxp.mvps.org/shellnewadd.htm)

[attachment deleted by admin]
Title: Re: add a .bat file to right click contents menu
Post by: Carbon Dudeoxide on May 27, 2009, 08:29:15 AM
Intriguing....I never thought of that...

TweakUI, the Windows XP Powertoy, can do it.
http://www.microsoft.com/windowsxp/Downloads/powertoys/Xppowertoys.mspx
http://download.microsoft.com/download/f/c/a/fca6767b-9ed9-45a6-b352-839afb2a2679/TweakUiPowertoySetup.exe


If you're looking for a way to do it via the Registry, don't. It's not worth it.
Title: Re: add a .bat file to right click contents menu
Post by: macdad- on May 27, 2009, 10:19:26 AM
Thought about bringing that up, and yea...registry is not worth it for such a simple operation.
Title: Re: add a .bat file to right click contents menu
Post by: mioo_sara on May 27, 2009, 11:32:25 AM
thanks guys
links above were really  helpful
Title: Re: add a .bat file to right click contents menu
Post by: devcom on May 27, 2009, 12:01:17 PM
you can use this anyway:

Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.bat\ShellNew]
"Data"="@echo off"
"ItemName"="@%SystemRoot%\\system32\\notepad.exe,-470"

i have it like this and it works ;)
Title: Re: add a .bat file to right click contents menu
Post by: mioo_sara on May 27, 2009, 03:07:26 PM
Quote
you can use this anyway:

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.bat\ShellNew]
"Data"="@echo off"
"ItemName"="@%SystemRoot%\\system32\\notepad.exe,-470"

i have it like this and it works

sorry devcom
i  copied your codes in  a reg  key   and execute it but i dont have  it in  my  right click why?
should i  restart my  win xp?

i  dont want  .bat in  my  new
i want to  add one program.bat  in  my  right click
Title: Re: add a .bat file to right click contents menu
Post by: devcom on May 27, 2009, 03:21:09 PM
ok, so you need to look for app ShellExView, this should help you ;)

Code: [Select]
http://www.nirsoft.net/utils/shexview.html
Title: Re: add a .bat file to right click contents menu
Post by: BatchFileBasics on May 27, 2009, 06:32:29 PM
do you mean to add files to a right click menu like this?
(http://i41.tinypic.com/dc3dvl.jpg)
Title: Re: add a .bat file to right click contents menu
Post by: mioo_sara on May 27, 2009, 11:32:46 PM
yes BatchFileBasics
i  need it  to  be avtive both  on  folders and files
thanks if you  van  make a script i will  be greatfull
Title: Re: add a .bat file to right click contents menu
Post by: BatchFileBasics on May 28, 2009, 06:09:51 PM
well this is for the "all' files but not folders:
and you save it in notepad as "anything.REG"
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Name of command\command]
@="\"c:\\path of file\\file.bat\" \"%1\""

replace "Name of command" with what you want the right click descipt to be.
but leave alone the "command" at the end

Code: [Select]
@="\"c:\\path of file\\file.bat\" \"%1\""
adds the key to the registry.
your normal file would be c:\path of file\file.bat
but all the \ mean to not count as a new command\line

regularly it is :
Code: [Select]
"c:\path of file\file.bat\" "%1"
but you need the slashes so:
Code: [Select]
"\"c:\\path of file\\file.bat\" \"%1\"
Title: Re: add a .bat file to right click contents menu
Post by: mioo_sara on May 29, 2009, 03:55:00 AM
it worked thanks my  dear BatchFileBasics
i  have  my.bat file in  my right click options now
i am  satisfied now
thank you  again
Title: Re: add a .bat file to right click contents menu
Post by: BatchFileBasics on May 29, 2009, 04:57:43 PM
you are all welcome to whom gave me a thanked up.
:P

and mioo_sara, welcome to the forums :)
Title: Re: add a .bat file to right click contents menu
Post by: TheHoFL on June 17, 2009, 10:39:17 AM
I know this is an older post, but i tired and have one issue. When i right click a blank area, there is no "Create New BAT" like registry specified. It simply added an option for when i right click an file. Has anyone got this to work on the right click menu or the "File>new" menu?

Here is my REG file:
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Create New BAT\command]
@="\"C:\\Documents and Settings\\mhofmann\\My Documents\\Test\\file.bat\" \"%1\""


Thanks for the help!
Title: Re: add a .bat file to right click contents menu
Post by: BatchFileBasics on June 17, 2009, 11:58:32 AM
well you are not the only one curious about it, i found the key:
Code: [Select]
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Discardable\PostSetup\ShellNew
but i have no idea how or what to edit to create a new batch file or anything