1

Problems:

  • When I click on bat file to run it I get the error:

Windows cannot find 'c:\example\example.bat'. Make sure you typed the name correctly and then try again.

  • When I run aforementioned bat file from cmd.exe the exes from c:\windows\system32 are not found:

'findstr' is not recognized as an internal or external command, operable program or batch file.

Notes:

  • I have admin rights
  • The win10 is freshly installed

3 Answers 3

2

Problem was I had system variable ComSpec set to

C:\Windows\system32\cmd.exe;C:\Windows\SysWOW64\cmd.exe

Solution: Change ComSpec variable to

C:\Windows\system32\cmd.exe

(No ; at the end)

2
  • a fresh Windows 10 installation had a SysWOW64 entry in your environment variables?
    – mael'
    Commented Jul 9, 2019 at 15:39
  • 1
    Good point. I work in corporate environment and we are in the process of migration from Windows 7 to Windows 10. Part of this process was a scan of installed apps in Win7. The new "freshly" installed Win10 came with some of those apps installed. My guess would be that one of those apps installed in the background added SysWOW64 cmd.exe. Commented Jul 9, 2019 at 15:45
0
- Run cmd as Admin
- Open file explorer and navigate to the folder its in
- Click the file explorer navbar and copy the location of the folder 
- Open cmd and paste the location, typing the name of the bat file after the pasted text

If this doesn't work there have almost certainly been some changes to your environment variables.

If you run the following command you can see your environment variables

SET | more

The cmd variable should be as follows:

C:\System32\cmd.exd
0

I ran in to this problem and the cause turned out to be that the bat file was empty.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .