Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Can't run .bat files

22 Feb 2015   #21
Peter57r

windows 7 64
 
 

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 System SpecsSystem Spec
.
22 Feb 2015   #22
Peter57r

windows 7 64
 
 

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 System SpecsSystem Spec
22 Feb 2015   #23
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 



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 System SpecsSystem Spec
.

22 Feb 2015   #24
Peter57r

windows 7 64
 
 

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 System SpecsSystem Spec
22 Feb 2015   #25
Brink

64-bit Windows 10 Pro
 
 

Great news, and great job Pyprohly.
My System SpecsSystem Spec
22 Feb 2015   #26
Layback Bear

Windows 7 Pro. 64/SP-1
 
 

Another happy customer. Well done folks.

@Pyprohly

You are just full of neat trick. Well done.
My System SpecsSystem Spec
26 Mar 2015   #27
testing1

Windows 7, 64 bit
 
 
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 System SpecsSystem Spec
26 Mar 2015   #28
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by testing1 View Post
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.


Quote   Quote: Originally Posted by Peter57r View Post
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.
Quote   Quote: Originally Posted by testing1 View Post
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 System SpecsSystem Spec
26 Mar 2015   #29
testing1

Windows 7, 64 bit
 
 

Quote   Quote: Originally Posted by Pyprohly View Post
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!

Quote   Quote: Originally Posted by Pyprohly View Post
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 System SpecsSystem Spec
Reply

 Can't run .bat files




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Windows 7 won't boot, SFC found corrupt files, hdd/files still intact
I get a windows boot error 0xc000000e if I try to boot into safe mode or launch startup repair through through windows boot manager. I tried using a windows 7 recovery usb but startup repair says it cannot repair the problem automatically. Through the command line I ran chkdsk /f and /r multiple...
Performance & Maintenance
.wma files appears as .dat files in Temporary Internet Files folder
Hi, I am running IE8 on Windows 7 (Home Premium 64bit). My Temporary Internet Files folder is C:\Users\<username>\AppData\Local\Microsoft\Windows\Temporary Internet Files\Low\Content.IE5. I have enabled Show Hidden Files and Folders and removed the tick for Hide Protected Operating System...
Browsers & Mail
worrd 2007 only opening old files, not open revised files
My wife has Win7 home premium x64 on her laptop and is using Word 2007. The problem she is having is she will open a word file, change it up, save it, then re-open it later and its the old file not the new one. Where as I can open the edited file on my desktop running the same OS but with Word...
Microsoft Office
error-failed to load locale files from "Program Files\Western Digital\
failed to load locale files from "Program Files\Western Digital\WD Smartware\Locale" The menu box it's under is entitled " WDContextMenuHandler " I get this error when I just right click on any part of "my computer" everytime. the pc then goes blank on desktop while it says " windows...
BSOD Help and Support
.reg files open Notepad - do not change registry to read older files
Running Win7Pro 64-bit. Am unable to open older Office 97 files with Office2003 which is installed and running fine. I found a couple of files here and elsewhere with .reg extensions that were supposed to make the necessary registry changes. eg. "UnlockWord.reg" and a more elaborate-looking...
Microsoft Office
Offline files doen't update files changed locally
My offline files seems to work offline all the time, even when it shows me being online. I sync most of my business files to my laptop for working at home at night. When I edit a file from my Win 7 (pro, 64-bit) laptop, then go to edit it again, I get the version I had changed, but no one else...
Network & Sharing


Our Sites

Site Links

About Us

Find 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 06:51.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App