Double-click to run .bat - Windows cannot find file

Page 1 of 2 12 LastLast

  1. Posts : 12
    Windows 10
       #1

    Double-click to run .bat - Windows cannot find file


    Recently (seemingly out of nowhere) my Windows 10 PC stopped running .bat files when I double-click on them. If I right-click and "Run as administrator" the files run. If I open a command prompt and invoke the bat file it also runs. This is true for every bat file I have tried in all of the different folders and drives I have tried.

    For example, I created Test.bat in M:\Downloads\. The content of this file is just one command "pause".
    This is the error message I get when double-clicking the file in explorer:
    Double-click to run .bat - Windows cannot find file-capture.png

    Right-click and "Run as administrator":
    Double-click to run .bat - Windows cannot find file-capture-3.png

    And from a command prompt:
    Double-click to run .bat - Windows cannot find file-capture-2.png

    I have tried the following:
    1. File Association Fixer
    2. Checked the system environment variable COMSPEC. It is correct: %SystemRoot%\system32\cmd.exe.
    3. sfc /scannow - the result was "Verification 100% complete. Windows Resource Protection did not find any integrity violations."

    Any ideas?
      My Computer


  2. Posts : 5,176
    64bit Win 10 Pro ver 21H2
       #2

    You could try the specific .bat file restorer provided by TenForums: Restore Default File Type Associations in Windows 10 - Windows 10 Customization Tutorials
      My Computers


  3. Posts : 12
    Windows 10
    Thread Starter
       #3

    Unfortunately the .bat file restorer did not fix the problem. Thank you for the suggestion.
      My Computer


  4. Posts : 5,176
    64bit Win 10 Pro ver 21H2
       #4

    If you right click on the file, select properties and look in the details tab - does it show the correct file name, file type and folder path?
      My Computers


  5. Posts : 12
    Windows 10
    Thread Starter
       #5

    Yes, the properties are all correct. This happens with any and all bat files, not just this test file.
      My Computer


  6. Posts : 34,992
    Win 10 Pro (1903) (2nd PC is 21H2)
       #6

    Hi, this sounds as if it might be a permissions problem.

    Also see
    Cant run .bat (Batch Files)
      My Computers


  7. Posts : 379
    Windows 10-Pro 64bit
       #7

    Change settings in User Account Control.
      My Computers


  8. Posts : 12
    Windows 10
    Thread Starter
       #8

    I tried the proposed solutions in the technet thread, none fixed the problem.
    User Account Control is set to "Never Notify".

    I tried changing the file extension on my Test bat file to .cmd. The same issue occurs. It's not a file extension specific problem.
      My Computer


  9. Posts : 13,934
    Windows 10 Pro X64 21H1 19043.1503
       #9

    When you right click on a bat file, what is the default action highlighted? Should be Open.

    Also check your path environment variable.
      My Computers


  10. Posts : 12
    Windows 10
    Thread Starter
       #10

    The default is Open

    PATH system variable:
    Double-click to run .bat - Windows cannot find file-capture-4.png
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 18:24.
Find Us




Windows 10 Forums