Windows 10: Double-click to run .bat - Windows cannot find file Solved

Page 1 of 2 12 LastLast
  1.    26 Apr 2017 #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:
    Click image for larger version. 

Name:	Capture.PNG 
Views:	47 
Size:	8.5 KB 
ID:	132152

    Right-click and "Run as administrator":
    Click image for larger version. 

Name:	Capture 3.PNG 
Views:	47 
Size:	3.3 KB 
ID:	132154

    And from a command prompt:
    Click image for larger version. 

Name:	Capture 2.PNG 
Views:	47 
Size:	4.7 KB 
ID:	132153

    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 ComputerSystem Spec

  2. philc43's Avatar
    Posts : 3,561
    64bit Win 10 Pro ver 1803 Build 17134.285 and W10 Insider Build 18234
       27 Apr 2017 #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 ComputersSystem Spec

  3.    27 Apr 2017 #3

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

  4. philc43's Avatar
    Posts : 3,561
    64bit Win 10 Pro ver 1803 Build 17134.285 and W10 Insider Build 18234
       27 Apr 2017 #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 ComputersSystem Spec

  5.    27 Apr 2017 #5

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

  6.    27 Apr 2017 #6

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

    Also see
    Cant run .bat (Batch Files)
      My ComputerSystem Spec

  7. Comp Cmndo's Avatar
    Posts : 251
    Windows 10-Pro 64bit
       27 Apr 2017 #7

    Change settings in User Account Control.
      My ComputerSystem Spec

  8.    27 Apr 2017 #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 ComputerSystem Spec

  9. Ztruker's Avatar
    Posts : 6,215
    Windows 10 Pro X64 17134.191
       27 Apr 2017 #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 ComputersSystem Spec

  10.    27 Apr 2017 #10

    The default is Open

    PATH system variable:
    Click image for larger version. 

Name:	Capture 4.PNG 
Views:	20 
Size:	6.1 KB 
ID:	132328
      My ComputerSystem Spec

Page 1 of 2 12 LastLast

Related Threads
How to Open Items with Single-Click or Double-Click in Windows 10 You can set Windows to open an item when you single-click/tap or double-click/tap on it. The single-click option allows you to open items (ex: files and folders) with a single...
Since the last update Win10 I cannot open folders with double click only right mouse click and then open folder. I have 3 times With Microsoft chatted but cannot solve this problem. Driver up to date, change mouse already, no hardware conflicts....
About a month ago my mouse started double clicking. Its random, like 20% of my clicks act as a double click. Tested with logitech g9, steelseries sensei and razer naga, so its definitely not a hw issue. Did clean win install with the lastest...
Hello, Every time i double a folder at times it opens the folder in a new window "twice" - this is becoming really annoying. Is there a way for me to resolve this? I've followed the basic troubleshooting guides found when searching around but it...
Hello, I use a HP laptop & since the last few days I am not able to open any files or click on something since the left (main) key & double tap on the mouse pad are not working! Although I am able to move the cursor/pointer over the touch pad & the...
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:35.
Find Us