Can't run .bat files

Page 3 of 3 FirstFirst 123

  1. Posts : 11
    windows 7 64
    Thread Starter
       #21

    Brink
    A very sensible suggestion of using system restore.
    Unfortunately I have no idea when .bat files stopped working. I haven't created a bat file myself for about 10 years. I switched to .vbs files when I could as they were more in line with my programming knowledge at that time .
    Looking at all the batch files on my pc, it seems that before the Android studio installation which revealed this issue I had no .bat file on my pc that was later than 2010.
    And the other issue I have is that I have installed and uninstalled what I believed to be the 'problem' software so many times over the last two weeks that I've pushed any earlier restore points off my machine. Even after a lifetime in IT I can still fail to have proper backups!!
      My Computer


  2. Posts : 11
    windows 7 64
    Thread Starter
       #22

    pyprohly- Oh Boy!!! That looks like the culprit. There was an extra entry in there in addition to cmd.exe - I don't know if I added by mistake it thinking I was editing PATH or it was added by the Android stuff, but I've removed it and it looks like things might be working again. I have to do a bit more testing yet but this is most promising step so far.

    Thank you so much - if this fixes it you cannot imagine how grateful I am.
      My Computer


  3. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #23



    For anyone else with a broken ComSpec variable (and can't run batch files), with an Elevated Command Prompt,
    Code:
    setx ComSpec %SystemRoot%\system32\cmd.exe /m
    to reset the environment variable to what it should be.
      My Computer


  4. Posts : 11
    windows 7 64
    Thread Starter
       #24

    I've spent a few hours reloading everything I'd unloaded over the past few days, and it all seems OK.
    So thanks to all who responded but of course especially to pyprohly who persuaded me to check something I assumed(!!) would not be an issue.
      My Computer


  5. Posts : 72,046
    64-bit Windows 11 Pro for Workstations
       #25

    Great news, and great job Pyprohly.
      My Computer


  6. Posts : 25,847
    Windows 10 Pro. 64/ version 1709 Windows 7 Pro/64
       #26

    Another happy customer. Well done folks.

    @Pyprohly

    You are just full of neat trick. Well done.
      My Computer


  7. Posts : 2
    Windows 7, 64 bit
       #27

    Pyprohly you are my hero!!!


    Thank you so much!!! Had the same issue for about half a year and finally found your solution!!!!!
    You can't imagine how happy I am!!!
    I got this issue while trying android studios too... That google...xD
    WOW, I'm so happy!!! Can't stop to repeat it
    Thanks to Pyprohly
      My Computer


  8. Posts : 721
    Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
       #28

    testing1 said:
    Had the same issue for about half a year and finally found your solution!!!!!
    That must have been a lot of Web digging. Glad you found what you're looking for here.


    Peter57r said:
    Lots of other people are using the same source material, apparently without this problem as no-one has any idea what I'm talking about.
    testing1 said:
    I got this issue while trying android studios too... That google...xD
    Somebody who understands you, Peter :')

    How these ComSpec variables get out of place in the first place is what I wanna to know. Something fishy about that Android Studios...
      My Computer


  9. Posts : 2
    Windows 7, 64 bit
       #29

    Pyprohly said:
    That must have been a lot of Web digging. Glad you found what you're looking for here.
    Oh yes, it was! I gave up on it with a workaround, because I could run the .bat as admin and most other things worked with that too.
    But then about a month ago I had problems again and today I tried to find a solution and finally found that thread! :)

    Pyprohly said:
    How these ComSpec variables get out of place in the first place is what I wanna to know. Something fishy about that Android Studios...
    Yeah, don't know what's wrong... My ComSpec was set to something with java jdk... maybe this has something to do with it too...

    However first thing I did right now after I fixed it was downloading Android Studio again hope this time I've more luck xD
      My Computer


 
Page 3 of 3 FirstFirst 123

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

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