0

I'm trying to run a .bat file which contains the below code

echo "Test"
pause

It throws the following error

Windows cannot find 'c:\Users\test\Desktop\run.bat'.
Make sure you typed the name correctly, and then try again.

enter image description here

The above user has all administrator rights.

But when I run this .bat as Run as Administrator it is executing properly. I tried running in new user account with admin privileges but still no luck.

I tried to modify regedit:

Hkey_Current_User\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.bat

But .bat key doesn't exist there.

3
  • is your cmd.exe file within the system32 folder? – DarkEvE Oct 8 '14 at 10:25
  • What happens if you put the .bat file in another folder, say, c:\temp? – Berend Oct 8 '14 at 17:22
  • How are you (trying to) run it? Double-click in Windows Explorer? "Run" dialog box (Win+R)? From an interactive Command Prompt? – G-Man Says 'Reinstate Monica' Oct 8 '14 at 22:02
1

check to see if the actual cmd.exe is within the system32 folder, if it is then try opening the file through the cmd itself.

C:\Users\kamal\Desktop\run.bat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.