murrayhome
asked on
CMD not running a batch file when I double-click the .bat file
Normally, double-clicking a .bat file's icon (or a shortcut to the same) should open a command processor window and run that batch file there. Now the command processor window opens, but the batch file does not run. (But the batch file does run either after I type its name at the command line in the window, or if, instead, from the Start Menu I use Run and in the "Open:" input box type:
cmd /c path_to_bat_file\batch_fil ename.bat
How can I reassociate batch files with the default Window API action?
I tried the standard approacyh of going to Tools > Folder Options File Types and associating .bat files with type MS-DOS Batch File and specifying that .bat files should be opened with Windows Command Processor. But that does not correct the problem.
I also checked the Registry. In HKEY_CLASSES_ROOT, the entry for .bat gives under key PersistentHandler a CLSID that has under its own key PersistentAddinsRequired a subkey that points to a CLSID whose subkey InProcServer has two subkeys: (Default) with value query.dll and ThreadingModel with value Both.
Note that this behavior appeared after I installed JP Software's 4NT command processor and opted to make it the default processor for command prompt windows. However, I have since uninstalled 4NT.
cmd /c path_to_bat_file\batch_fil
How can I reassociate batch files with the default Window API action?
I tried the standard approacyh of going to Tools > Folder Options File Types and associating .bat files with type MS-DOS Batch File and specifying that .bat files should be opened with Windows Command Processor. But that does not correct the problem.
I also checked the Registry. In HKEY_CLASSES_ROOT, the entry for .bat gives under key PersistentHandler a CLSID that has under its own key PersistentAddinsRequired a subkey that points to a CLSID whose subkey InProcServer has two subkeys: (Default) with value query.dll and ThreadingModel with value Both.
Note that this behavior appeared after I installed JP Software's 4NT command processor and opted to make it the default processor for command prompt windows. However, I have since uninstalled 4NT.
Hi Murrayhome,
The default .BAT file association fix is available here.
http://www.dougknox.com/xp/file_assoc.htm
The default .BAT file association fix is available here.
http://www.dougknox.com/xp/file_assoc.htm
ASKER
Unfortunately restoring the default .BAT file association like that (even after un-installing 4NT again, and rebooting) does NOT fix the problem. Still when I double-click a .bat file, all that happens is that a command prompt window opens up with the command prompt showing the path to the .bat file I tried to run. But the .bat file has NOT run!
Can you post the .BAT file association info. The "FileExtInfo" utility can gather all the info to a file.
FileExtInfo - View the association settings for a file type easily:
http://windowsxp.mvps.org/fileextinfo.htm
FileExtInfo - View the association settings for a file type easily:
http://windowsxp.mvps.org/fileextinfo.htm
ASKER
Here is the info:
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~
FileExtInfo v1.0 - Log file
7/16/2006 11:14:17 AM
Complete File association information for ---> .BAT
Useful for troubleshooting File association and other problems
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~
[HKEY_CLASSES_ROOT\.BAT]
@="batfile"
"ZAMailSafeExt"="zl3"
[HKEY_CLASSES_ROOT\.BAT\Pe rsistentHa ndler]
@="{5e941d80-bf96-11cd-b57 9-08002b30 bfeb}"
[HKEY_CLASSES_ROOT\batfile ]
@="MS-DOS Batch File"
"EditFlags"=hex:30,04,00,0 0
[HKEY_CLASSES_ROOT\batfile \DefaultIc on]
@=hex(2):25,00,53,00,79,00 ,73,00,74, 00,65,00,6 d,00,52,00 ,6f,00,6f, 00,74,00,2 5,\
00,5c,00,53,00,79,00,73,00 ,74,00,65, 00,6d,00,3 3,00,32,00 ,5c,00,73, 00,68,00,\
65,00,6c,00,6c,00,33,00,32 ,00,2e,00, 64,00,6c,0 0,6c,00,2c ,00,2d,00, 31,00,35,\
00,33,00,00,00
[HKEY_CLASSES_ROOT\batfile \shell]
[HKEY_CLASSES_ROOT\batfile \shell\edi t]
[HKEY_CLASSES_ROOT\batfile \shell\edi t\command]
@=hex(2):25,00,53,00,79,00 ,73,00,74, 00,65,00,6 d,00,52,00 ,6f,00,6f, 00,74,00,2 5,\
00,5c,00,53,00,79,00,73,00 ,74,00,65, 00,6d,00,3 3,00,32,00 ,5c,00,4e, 00,4f,00,\
54,00,45,00,50,00,41,00,44 ,00,2e,00, 45,00,58,0 0,45,00,20 ,00,25,00, 31,00,00,\
00
[HKEY_CLASSES_ROOT\batfile \shell\ope n]
"EditFlags"=hex:00,00,00,0 0
[HKEY_CLASSES_ROOT\batfile \shell\ope n\command]
@="\"%1\" %*"
[HKEY_CLASSES_ROOT\batfile \shell\pri nt]
[HKEY_CLASSES_ROOT\batfile \shell\pri nt\command ]
@=hex(2):25,00,53,00,79,00 ,73,00,74, 00,65,00,6 d,00,52,00 ,6f,00,6f, 00,74,00,2 5,\
00,5c,00,53,00,79,00,73,00 ,74,00,65, 00,6d,00,3 3,00,32,00 ,5c,00,4e, 00,4f,00,\
54,00,45,00,50,00,41,00,44 ,00,2e,00, 45,00,58,0 0,45,00,20 ,00,2f,00, 70,00,20,\
00,25,00,31,00,00,00
[HKEY_CLASSES_ROOT\batfile \shellex]
[HKEY_CLASSES_ROOT\batfile \shellex\C ontextMenu Handler]
[HKEY_CLASSES_ROOT\batfile \shellex\C ontextMenu Handler\Cl eanSweep]
@="{BA995680-DDEE-11CF-9E0 5-44455354 0000}"
[HKEY_CLASSES_ROOT\batfile \shellex\C ontextMenu Handlers]
@=""
[HKEY_CLASSES_ROOT\batfile \shellex\C ontextMenu Handlers\C leanSweep]
@="{BA995681-DDEE-11cf-9E0 5-44455354 0000}"
[HKEY_CLASSES_ROOT\batfile \shellex\D ropHandler ]
@="{86C86720-42A0-1069-A2E 8-08002B30 309D}"
[HKEY_CLASSES_ROOT\batfile \shellex\P ropertyShe etHandlers ]
[HKEY_CLASSES_ROOT\batfile \shellex\P ropertyShe etHandlers \PifProps]
@="{86F19A00-42A0-1069-A2E 9-08002B30 309D}"
[HKEY_CLASSES_ROOT\batfile \shellex\P ropertyShe etHandlers \ShimLayer Property Page]
@="{513D916F-2A8E-4F51-AEA B-0CBC76FB 1AF8}"
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Explo rer\FileEx ts\.BAT]
"Application"="cmd.exe"
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Explo rer\FileEx ts\.BAT\Op enWithList ]
"a"="4nt.exe"
"MRUList"="ba"
"b"="cmd.exe"
[HKEY_CURRENT_USER\Softwar e\Microsof t\Windows\ CurrentVer sion\Explo rer\FileEx ts\.BAT\Op enWithProg ids]
"batfile"=hex(0):
~~~~~~~~~~~~~~~~~~~~~~~~~~
FileExtInfo v1.0 - Log file
7/16/2006 11:14:17 AM
Complete File association information for ---> .BAT
Useful for troubleshooting File association and other problems
~~~~~~~~~~~~~~~~~~~~~~~~~~
[HKEY_CLASSES_ROOT\.BAT]
@="batfile"
"ZAMailSafeExt"="zl3"
[HKEY_CLASSES_ROOT\.BAT\Pe
@="{5e941d80-bf96-11cd-b57
[HKEY_CLASSES_ROOT\batfile
@="MS-DOS Batch File"
"EditFlags"=hex:30,04,00,0
[HKEY_CLASSES_ROOT\batfile
@=hex(2):25,00,53,00,79,00
00,5c,00,53,00,79,00,73,00
65,00,6c,00,6c,00,33,00,32
00,33,00,00,00
[HKEY_CLASSES_ROOT\batfile
[HKEY_CLASSES_ROOT\batfile
[HKEY_CLASSES_ROOT\batfile
@=hex(2):25,00,53,00,79,00
00,5c,00,53,00,79,00,73,00
54,00,45,00,50,00,41,00,44
00
[HKEY_CLASSES_ROOT\batfile
"EditFlags"=hex:00,00,00,0
[HKEY_CLASSES_ROOT\batfile
@="\"%1\" %*"
[HKEY_CLASSES_ROOT\batfile
[HKEY_CLASSES_ROOT\batfile
@=hex(2):25,00,53,00,79,00
00,5c,00,53,00,79,00,73,00
54,00,45,00,50,00,41,00,44
00,25,00,31,00,00,00
[HKEY_CLASSES_ROOT\batfile
[HKEY_CLASSES_ROOT\batfile
[HKEY_CLASSES_ROOT\batfile
@="{BA995680-DDEE-11CF-9E0
[HKEY_CLASSES_ROOT\batfile
@=""
[HKEY_CLASSES_ROOT\batfile
@="{BA995681-DDEE-11cf-9E0
[HKEY_CLASSES_ROOT\batfile
@="{86C86720-42A0-1069-A2E
[HKEY_CLASSES_ROOT\batfile
[HKEY_CLASSES_ROOT\batfile
@="{86F19A00-42A0-1069-A2E
[HKEY_CLASSES_ROOT\batfile
@="{513D916F-2A8E-4F51-AEA
[HKEY_CURRENT_USER\Softwar
"Application"="cmd.exe"
[HKEY_CURRENT_USER\Softwar
"a"="4nt.exe"
"MRUList"="ba"
"b"="cmd.exe"
[HKEY_CURRENT_USER\Softwar
"batfile"=hex(0):
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the same) does NOT run it -- it just opens a 4NT command window.
Currently, with 4NT re-installed, the same PersistentHandler chain of
references in the Registry persists. Currently, the value in HKLM for
batfile > shell > open > command is:
"D:\Utilities\JPSoft\4NT7\
This really has me puzzled. The /c part of the registry key is, I thought, what makes the command processor run the command that follows it.