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

21 Feb 2015   #11
Callender

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Post the contents of the batch file.

Quote:
Double clicking a .bat file now opens the command processor, but the file still does not run. This might be because when running the .reg file I get messages that some keys cannot be imported because they are in use. However, I don't know how to get past this problem, because from my perspective I'm not running anything at the time. There are no apps running in task manager. I've tried running regedit in Safe mode but it produces the same messages.
Did you ever get round that problem? If not try RegOwnershipEx:

help installing lines to register

Navigate to and take ownership of HKEY_CLASSES_ROOT\batfile\

Leave the program running and merge your reg file. Then restore ownership.


My System SpecsSystem Spec
.
21 Feb 2015   #12
Peter57r

windows 7 64
 
 

It's every .bat file.
Moving to the desktop does not change anything.
My System SpecsSystem Spec
21 Feb 2015   #13
Callender

Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
 
 

Also do you have this shown in Environment Variables?
Can't run .bat files-ev2.jpg
Can't run .bat files-ev.jpg


My System SpecsSystem Spec
.

21 Feb 2015   #14
Peter57r

windows 7 64
 
 

Yes, I have .BAT in my PATHEXT.

Just to summarise where I am....
No .bat files will run when double-clicked or "Open"-ed.
A .bat file can be run by right-clicking and using "Run As Administrator".
A .bat file will run in the command processor (standard or elevated) using the full path to the file.

I have googled this extensively over 3 days and can find similar problems. But suggestions stop once it reaches the same point as I am now.
My System SpecsSystem Spec
21 Feb 2015   #15
Brink

64-bit Windows 10 Pro
 
 

Peter,

If you haven't already, you might see if doing a system restore using a restore point dated before this started happening may be able undo and fix it.
My System SpecsSystem Spec
21 Feb 2015   #16
Pyprohly

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

Hi Peter,

Check your batch files' open command string.

In a command prompt type the following,
Code:
ftype batfile
Post back the result.
My System SpecsSystem Spec
21 Feb 2015   #17
Layback Bear

Windows 7 Pro. 64/SP-1
 
 

I'm no expert on .bat files but because of this I think you have a privilege problem not a .bat problem.

From post #5

Quote:
I have since discovered that if I rightclick a .bat file and 'Run As Administrator' the file runs. However, my research suggest that it is impossible to set cmd.exe to run as admin automatically.
I will go back to watching and leave my thoughts to the experts.
My System SpecsSystem Spec
22 Feb 2015   #18
Peter57r

windows 7 64
 
 

Layback Bear
I am slowly coming to the same conclusion. Unfortunately it doesn't move me on at all as the only things I know about are UAC control settings and Run as Admin. I have set UAC to the lowest level and Run As Admin can't be set on cmd.exe. I even tried to copy cmd.exe out of system32 , set Run as Admin on the copy (which I could do) and then copy it back in. But Of course I can't paste anything INTO system32.
My System SpecsSystem Spec
22 Feb 2015   #19
Peter57r

windows 7 64
 
 

pyprohly Thanks for the suggestion. Already been there though.


Attached Images
Can't run .bat files-bat4.png 
My System SpecsSystem Spec
22 Feb 2015   #20
Pyprohly

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

Okay. Those look good.

Now lets check the %ComSpec% variable...
Code:
echo %COMSPEC%
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 17:01.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App