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 10 Pro. 64/ version 1709 Windows 7 Pro/64
 
 

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




Similar help and support threads
Thread Forum
Pagefile, Temporary Int Files, Temp files reset after update
Hello, I have a system with 32gb DDR3-2400, a 256GB SSD and a couple of spinners. I have set up 4gb of the RAM to be used as another RAMdisk using the softperfect software. This problem has been going on for some time, but has been more of a problem since I started using the RAMdisk. Not...
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
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
Temp Internet files folder is 118GB full, but no files???
Hello. I hope that someone can help me with my problem. I a lower-intermediate on a computer. I have my tower pc on constant all day- to record a streaming IP Camera from my work. Initially, I saved these files into my docutments- which they would save as .avi files, and after every several...
Browsers & Mail
.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


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 14:15.
Twitter Facebook Google+