none
Can't run .bat (Batch Files)

    Question

  • I accidentally chose notepad as the default program to open .bat files when I needed to edit it.  Now I can't run batch files on Windows 7.  How do I run batch files again?
    Wednesday, September 16, 2009 2:54 AM

Answers

All replies

  • Hi Greg, we can manually edit registry or run the following tool to reset the association:

    http://cid-669c358ca3dd94c7.skydrive.live.com/self.aspx/.Public/batfix.zip

    Unzip the zip, double click the file, after importing the reg information, you can double click and run the bat file.

    Hope this helps!
    Sean Zhu - MSFT
    Wednesday, September 16, 2009 6:32 AM
    Moderator
  • All you have to do is open the registry and deletete this key:

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

    Done.

    • Proposed as answer by ONE ZERO Wednesday, September 16, 2009 6:26 PM
    • Marked as answer by Kellerman Software Wednesday, September 16, 2009 6:27 PM
    Wednesday, September 16, 2009 6:21 PM
  • Ran it but no difference. I am trying to start Outlook from a batch file. Here is my syntax:

    cmd /c "c:\program files\microsoft office\office12\outlook.exe"

    The response I get is

    'c:\program' is not recognized as an internal or external command, operable program or batch file.

    Given that it is in double quotes, not sure why Windows 7 suddenly doesn't recognize it?
    Wednesday, October 28, 2009 1:15 PM
  • Make sure the path is correct.
    Wednesday, October 28, 2009 7:45 PM
  • Yep, that was the last problem. Thank you for pointing out the obvious! :)
    Wednesday, October 28, 2009 11:19 PM
  • That worked. Thank you. Now, how to change default from Open to Edit?

    Friday, May 20, 2011 12:48 PM
  • Thanks Your suggestion works for me.
    Wednesday, September 28, 2011 10:04 AM
  • batfix worked for me. UltraEdit had grabbed the file association for .bat and I couldn't get UltraEdit to release the file association. Thanks a lot for putting this together
    Tuesday, October 18, 2011 11:04 PM
  • It's the best and completely safe way to restore automated running batch files. No risk of system vulnerability like after installing unknown tools.
    Thanks ZERO Tolerance !!!
    Wednesday, March 14, 2012 1:27 PM
  • Thankx . this did it.

    Thursday, February 20, 2014 8:08 PM