Solved

CMD not running a batch file when I double-click the .bat file

Posted on 2006-07-15
6
1,098 Views
Last Modified: 2010-08-05
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_filename.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.
0
Comment
Question by:murrayhome
  • 3
  • 3
6 Comments
 

Author Comment

by:murrayhome
ID: 17116030
Some additional information:   I re-installed 4NT, but still, clicking a .bat file's icon (or shortcut to
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\4nt.exe" /c "%1" %*

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.
0
 
LVL 34

Expert Comment

by:sramesh2k
ID: 17116156
Hi Murrayhome,

The default .BAT file association fix is available here.

http://www.dougknox.com/xp/file_assoc.htm
0
 

Author Comment

by:murrayhome
ID: 17116412
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!
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 34

Expert Comment

by:sramesh2k
ID: 17116598
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
0
 

Author Comment

by:murrayhome
ID: 17117440
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\PersistentHandler]
@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"


[HKEY_CLASSES_ROOT\batfile]
@="MS-DOS Batch File"
"EditFlags"=hex:30,04,00,00

[HKEY_CLASSES_ROOT\batfile\DefaultIcon]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,73,00,68,00,\
  65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,00,2c,00,2d,00,31,00,35,\
  00,33,00,00,00

[HKEY_CLASSES_ROOT\batfile\shell]

[HKEY_CLASSES_ROOT\batfile\shell\edit]

[HKEY_CLASSES_ROOT\batfile\shell\edit\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,45,00,20,00,25,00,31,00,00,\
  00

[HKEY_CLASSES_ROOT\batfile\shell\open]
"EditFlags"=hex:00,00,00,00

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

[HKEY_CLASSES_ROOT\batfile\shell\print]

[HKEY_CLASSES_ROOT\batfile\shell\print\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,4e,00,4f,00,\
  54,00,45,00,50,00,41,00,44,00,2e,00,45,00,58,00,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\ContextMenuHandler]

[HKEY_CLASSES_ROOT\batfile\shellex\ContextMenuHandler\CleanSweep]
@="{BA995680-DDEE-11CF-9E05-444553540000}"

[HKEY_CLASSES_ROOT\batfile\shellex\ContextMenuHandlers]
@=""

[HKEY_CLASSES_ROOT\batfile\shellex\ContextMenuHandlers\CleanSweep]
@="{BA995681-DDEE-11cf-9E05-444553540000}"

[HKEY_CLASSES_ROOT\batfile\shellex\DropHandler]
@="{86C86720-42A0-1069-A2E8-08002B30309D}"

[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers]

[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\PifProps]
@="{86F19A00-42A0-1069-A2E9-08002B30309D}"

[HKEY_CLASSES_ROOT\batfile\shellex\PropertySheetHandlers\ShimLayer Property Page]
@="{513D916F-2A8E-4F51-AEAB-0CBC76FB1AF8}"


[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.BAT]
"Application"="cmd.exe"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.BAT\OpenWithList]
"a"="4nt.exe"
"MRUList"="ba"
"b"="cmd.exe"

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.BAT\OpenWithProgids]
"batfile"=hex(0):

0
 
LVL 34

Accepted Solution

by:
sramesh2k earned 450 total points
ID: 17119539
Delete the value named "Application" in this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.BAT

0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
RDS 2012R2 with gateway and broker gives dual login prompt on XP 4 138
ntdlr  is missing or corrupt 15 135
FastLynx NT Device Driver is not installed 9 100
cloning computer 13 82
Disclosure: Use this tutorial only when no other options helps to get Windows XP running without any problems and you don't want to format the drive. The back up of the data is the responsible of the user, however there is a description of how t…
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now