Windows 10: bat files not being run when double clicked

Page 1 of 2 12 LastLast

  1. Posts : 7
    Windows 10 pro 18.06
       #1

    Windows 10: bat files not being run when double clicked


    Hi,

    somethings has been changed in my win10 64b pro (Microsoft Windows [Version 10.0.17763.134]) box, and now I have issues with bat files:

    When I double click on them, I get a cmd, empty that shows up for a couple of seconds, and then closes. The .bat is NOT run
    Of I open a cmd can cd to the dir containing the .bat, and I type the first letters of the .bat, TAB does not complete the file name, it does complete filenames of exe files.

    If I run the .bat from the cmd I opened in 2., it DOES run fine
    I have checked "assoc .bat" and "ftype batfile" and both return expected values.
    Any insight would be super useful...
      My Computer


  2. Posts : 8,111
    windows 10
       #2

    Welcome to the forum. Have you tried changing the extention to cmd as bag is old MS-DOS cmd
      My Computer


  3. Posts : 3,274
    Win10
       #3

    You can try to reset the batch file association using the instructions in Option 2 here ( download the reg file for bat file and follow the instructions ) in case the registry entry for bat files has become corrupted.

    Restore Default File Type Associations in Windows 10 | Tutorials
      My Computers


  4. Posts : 7
    Windows 10 pro 18.06
    Thread Starter
       #4

    Samuria said:
    Welcome to the forum. Have you tried changing the extention to cmd as bag is old MS-DOS cmd
    thanks for the reply. Just tried it, same effect (cmd console shows for a couple of seconds, empty, then goes away, withour running the file contents)
      My Computer


  5. Posts : 7
    Windows 10 pro 18.06
    Thread Starter
       #5

    das10 said:
    You can try to reset the batch file association using the instructions in Option 2 here ( download the reg file for bat file and follow the instructions ) in case the registry entry for bat files has become corrupted.

    Restore Default File Type Associations in Windows 10 | Tutorials
    not sure if that would do anything, as I mentioned assoc/ftype return expected values. I did anyway,and testing again, the behaviour remains the same. Thanks!
      My Computer


  6. Posts : 1,767
    Windows 10 Pro (+ Windows 10 Home VMs for testing)
       #6

    What AV are you using? BitDefender?
      My Computer


  7. Posts : 7
    Windows 10 pro 18.06
    Thread Starter
       #7

    RickC said:
    What AV are you using? BitDefender?
    just vanilla Windows Defender
      My Computer


  8. Posts : 8,111
    windows 10
       #8

    You say Of I open a cmd can cd to the dir containing the .bat are you running it from the folder if not it needs the full path or to be in the path or it wont find it. \whats in the file anything which might trigger AV
      My Computer


  9. Posts : 7
    Windows 10 pro 18.06
    Thread Starter
       #9

    Samuria said:
    You say Of I open a cmd can cd to the dir containing the .bat are you running it from the folder if not it needs the full path or to be in the path or it wont find it. \whats in the file anything which might trigger AV
    from a cmd, it runs fine both with the full path, and cd-ing to the forlder and running it without the path.

    No it is nothing out of the ordinary, Windows Defender does not say anythying either....
      My Computer


  10. Posts : 31,675
    10 Home x64 (22H2) (10 Pro on 2nd pc)
       #10

    vaderetro said:
    somethings has been changed in my win10 64b pro (Microsoft Windows [Version 10.0.17763.134]) box, and now I have issues with bat files:
    When I double click on them, I get a cmd, empty that shows up for a couple of seconds, and then closes. The .bat is NOT run Of I open a cmd can cd to the dir containing the .bat, and I type the first letters of the .bat, TAB does not complete the file name, it does complete filenames of exe files...
    Well, you live and learn. Didn't know that TAB trick

    I can confirm that in my Home x64 17763.134 double-clicking on a .bat works normally, as does TAB in a command prompt. Repeated TABs cycle through all existing extensions, including (in my test for 'M' in my user folder) .rtf, .bak, .bat and the link to "My Documents".

    Try another user account, does it behave the same way?

    Try adding a PAUSE statement as the first line in the .bat. Does it get that far? Or does it fail before even opening the .bat?

    Maybe Controlled Folder Access is blocking it? Try temporarily turning it off and see if it makes a difference.

    Enable or Disable Controlled Folder Access in Windows 10 | Tutorials
      My Computers


 

  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 00:21.
Find Us




Windows 10 Forums