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: Windows can't find the file when trying to run a .bat file

30 Jul 2014   #1
rush77

Windows Ultimate x64
 
 
Windows can't find the file when trying to run a .bat file

When I double click a .bat file windows says it can't find it, but if I do a direct access to the file then it runs it without any problem. Any idea?

Tanks!


My System SpecsSystem Spec
.
30 Jul 2014   #2
JDobbsy1987

Windows 8.1 Pro x64
 
 

Hi and Welcome to SevenForums.

Can you please post a screen shot of the error you are getting as i'm not quite sure what you mean?
Screenshots and Files - Upload and Post in Seven Forums

Can it not find the actual bat file you are double clicking or a file that the script in the bat file is trying to reference?

Regards,
Jamie
My System SpecsSystem Spec
30 Jul 2014   #3
rush77

Windows Ultimate x64
 
 

Quote   Quote: Originally Posted by JDobbsy1987 View Post
Hi and Welcome to SevenForums.

Can you please post a screen shot of the error you are getting as i'm not quite sure what you mean?
Screenshots and Files - Upload and Post in Seven Forums

Can it not find the actual bat file you are double clicking or a file that the script in the bat file is trying to reference?

Regards,
Jamie
It can't find the file I'm double clicking.
My Windows 7 is the spanish version, so I don't know if the scrrenshot will be of help.
My System SpecsSystem Spec
.

30 Jul 2014   #4
JDobbsy1987

Windows 8.1 Pro x64
 
 

Can you please clarify what you mean by it works when you do a direct access to the file?

Regards,
Jamie
My System SpecsSystem Spec
30 Jul 2014   #5
rush77

Windows Ultimate x64
 
 

Quote   Quote: Originally Posted by JDobbsy1987 View Post
Can you please clarify what you mean by it works when you do a direct access to the file?

Regards,
Jamie
Sorry. I meant a shortcut. If I create a shortcut to the .bat file then it runs without problems.
My System SpecsSystem Spec
30 Jul 2014   #6
NoelDP

Microsoft Community Contributor Award Recipient

Win 7 x64 Home Premium (and x86 VirtualBox VM)/Win10
 
 

Sounds like your environment variables have been changed, and the double-click is not opening the CMD properly.

Please open an Elevated Command Prompt, and run the following commands

REG QUERY HKEY_CLASSES_ROOT\.bat /S
REG QUERY HKEY_CLASSES_ROOT\.cmd /S
REG QUERY "HKCU\Volatile Environment" /S


Post the results.


Here are some instructions to make life easier
1) To open an Elevated Command Prompt Window (the ECP window), click on Start, All Programs, Accessories – then right-click on Command Prompt, and select Run as Administrator. Accept the UAC prompt.
2) To run the commands easier, highlight the block of commands, and right-click on the highlight – select Copy. In the CP Window, click on the black/white icon at top left – select Paste. The commands will run but may not complete the last command, so hit the Enter Key once.
3) To copy the results... click on the Black/White icon in the top left, and select Edit... 'Select All', and hit the Enter key - then use Ctrl+V or r-click+Paste to paste it into your response.
My System SpecsSystem Spec
30 Jul 2014   #7
rush77

Windows Ultimate x64
 
 

Code:
C:\Users\Roger>REG QUERY HKEY_CLASSES_ROOT\.bat /S

HKEY_CLASSES_ROOT\.bat
    (Predeterminado)    REG_SZ    batfile

HKEY_CLASSES_ROOT\.bat\PersistentHandler
    (Predeterminado)    REG_SZ    {5e941d80-bf96-11cd-b579-08002b30bfeb}


C:\Users\Roger>REG QUERY HKEY_CLASSES_ROOT\.cmd /S

HKEY_CLASSES_ROOT\.cmd
    (Predeterminado)    REG_SZ    cmdfile

HKEY_CLASSES_ROOT\.cmd\PersistentHandler
    (Predeterminado)    REG_SZ    {5e941d80-bf96-11cd-b579-08002b30bfeb}


C:\Users\Roger>REG QUERY "HKCU\Volatile Environment" /S

HKEY_CURRENT_USER\Volatile Environment
    LOGONSERVER    REG_SZ    \\2500K
    USERDOMAIN    REG_SZ    2500k
    USERNAME    REG_SZ    Roger
    USERPROFILE    REG_SZ    C:\Users\Roger
    HOMEPATH    REG_SZ    \Users\Roger
    HOMEDRIVE    REG_SZ    C:
    APPDATA    REG_SZ    C:\Users\Roger\AppData\Roaming
    LOCALAPPDATA    REG_SZ    C:\Users\Roger\AppData\Local

HKEY_CURRENT_USER\Volatile Environment\1
    SESSIONNAME    REG_SZ    Console
    CLIENTNAME    REG_SZ


C:\Users\Roger>
This are the results, but had no luck with double clicking .bat files: I get the same error.

It's an error window that says something like:

Code:
Windows can't find the file "filename.bat"
Make sure filename it's written correctly and try again.
filename.bat is the name of the file I'm double clicking.

(I'm translating from spanish so maybe in english it's not exactly the same message.)
My System SpecsSystem Spec
02 Aug 2014   #8
NoelDP

Microsoft Community Contributor Award Recipient

Win 7 x64 Home Premium (and x86 VirtualBox VM)/Win10
 
 

Hmmm - that's normal.

Let's look a little deeper...

Open an Elevated Command Prompt, and run the following commands.
Code:
 
 
REG QUERY HKCR\CLSID\{5e941d80-bf96-11cd-b579-08002b30bfeb}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}
REG QUERY HKCR\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb} /S
REG QUERY HKCR\CLSID\{DD75716E-B42E-4978-BB60-1497B92E30C4}\PersistentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}
REG QUERY HKCR\Wow6432Node\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb}
 
.
post the results
My System SpecsSystem Spec
02 Aug 2014   #9
rush77

Windows Ultimate x64
 
 

Results:

Code:
Microsoft Windows [Versión 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. Reservados todos los derechos.

C:\Users\Roger>REG QUERY HKCR\CLSID\{5e941d80-bf96-11cd-b579-08002b30bfeb}\Persi
stentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}

HKEY_CLASSES_ROOT\CLSID\{5e941d80-bf96-11cd-b579-08002b30bfeb}\PersistentAddinsR
egistered\{89BCB740-6119-101A-BCB7-00DD010655AF}
    (Predeterminado)    REG_SZ    {c1243ca0-bf96-11cd-b579-08002b30bfeb}


C:\Users\Roger>REG QUERY HKCR\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb} /S

HKEY_CLASSES_ROOT\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb}
    (Predeterminado)    REG_SZ    Plain Text filter
    LocalizedString    REG_SZ    @query.dll,-511

HKEY_CLASSES_ROOT\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb}\InprocServer32
    (Predeterminado)    REG_EXPAND_SZ    %systemroot%\system32\query.dll
    ThreadingModel    REG_SZ    Both


C:\Users\Roger>REG QUERY HKCR\CLSID\{DD75716E-B42E-4978-BB60-1497B92E30C4}\Persi
stentAddinsRegistered\{89BCB740-6119-101A-BCB7-00DD010655AF}

HKEY_CLASSES_ROOT\CLSID\{DD75716E-B42E-4978-BB60-1497B92E30C4}\PersistentAddinsR
egistered\{89BCB740-6119-101A-BCB7-00DD010655AF}
    (Predeterminado)    REG_SZ    {c1243ca0-bf96-11cd-b579-08002b30bfeb}


C:\Users\Roger>REG QUERY HKCR\Wow6432Node\CLSID\{c1243ca0-bf96-11cd-b579-08002b3
0bfeb}

HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb}
    (Predeterminado)    REG_SZ    Plain Text filter
    LocalizedString    REG_SZ    @query.dll,-511

HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{c1243ca0-bf96-11cd-b579-08002b30bfeb}\Inpro
cServer32
Still no luck. But now if I right click the .bat file and select run as administrator it runs...
I noticed that if a programs tries to run a .bat it says that it can't find the file, but I'm sure it's there.
My System SpecsSystem Spec
Reply

 Windows can't find the file when trying to run a .bat file




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Windows Backup Errors - Cannot Find the File Specified
Hi, I ran Windows backup and the backup didn't complete successfully due to some files that couldn't be found. The missing files are associated with the UpdatusUser user account. I think this user account is a type of system account that's used for application or program updates other than...
Backup and Restore
Which File? (The system cannot find the file specified)
I have a Windows 7 driver installation question that has been nagging me for awhile. I now turn to the forums for help. If I try to install a driver and not all of the driver files are present, I will get the error message "The system cannot find the file specified." But the problem is that it...
Drivers
How do you delete a file Windows can't find?
Hey there. I'm trying to clean my computer up a little, but for some reason, there's a file that it "could not find", even though it's showing it right on the desktop! What happened? The screen clipping is attached. If you're wondering, that's a Google Chrome extension installer. Garbage. ...
General Discussion
How to find Windows 7's application's EXE file
Hi Guys, I'm wondering... how can i find exe files of applications built in windows 7, for example: Exe| App taskmgr.exe | task manager cleanmgr.exe | Disk Cleanup wuapp.exe | Windows Update mblctr.exe | Mobility Center regedit.exe | Registry Editor C:\Windows\System32\rundll32.exe...
General Discussion
Can`t find iso file in Windows 7
I create an iso image file and backup, then i can`t find the iso file C:\(name of movie).iso in Windows 7 when i want to burn. In Windows XP it`s quite easy to find it-My computer>right click system C>open. Do you know why this is in Windows 7?
General Discussion
Downloaded Windows 7 but cant find an ISO file?
I have download Windows 7 with digital river. An icon named 'Win7-HP-Retail-en-us-x86' appered on desktop, when i opened it, it says 'unloading box' and put three more files on the desktop. 'Setup1.box' setup2.box' and 'expandedsetup' which is a folder. Ive searched inside and there is no ISO...
Installation & Setup


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 03:44.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App