Can't run .bat (Batch Files)


  • 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


All replies

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

    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
  • All you have to do is open the registry and deletete this key:



    • 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
  • This did not work for me.
    Tuesday, August 19, 2014 1:48 PM
  • This did not work for me either. I tried manually deleting the registry, and also importing the .reg. Neither worked for me. It still opens in notepad.
    Friday, May 01, 2015 3:40 PM
  • try

    @echo off

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

    pause >nul

    Thursday, July 13, 2017 6:18 PM
  • Hello zero if you have facebook invite me

    Thanks i need your help :)

    Tuesday, February 13, 2018 11:38 AM