Need assistance, can't run .bat files

When I run a .bat file I get an error saying:
“Windows cannot find ‘C:\ [Path]’. Make sure you typed the name correctly, and then try again.”

When I run the .bat file from the cmd terminal, it says:
“C:”’ is not recognized as an internal or external command, operable program or batch file.

My Path variable for cmd is set as “%SystemRoot%\system32\cmd.exe”

When I installed Node.js, I got this error:

81b67adb9819c7a021d5e78105f83ed3

For example, when I run the command “npm --version”, I get the version number back, but I also get the same Path error just like when I try running .bat files.

After trying to run the bat file in powershell I get this error:
The term ‘install.bat’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:12

  • install.bat <<<<
    • CategoryInfo : ObjectNotFound: (install.bat:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException

It’s been days since I’ve been looking for a solution, editing registry entries for cmd, editing Path variables etc. Would really need some external help at this point.

Thanks :T

Hmm that is all weird.

Do you have cmd.exe on your computer? Try type cmd.exe in the start menu search bar, open it.
It seems Windows 10 prefers to run powershell these days instead of the old cmd program.

When in cmd, type set and hit enter, this will show you the environment variables. Your path variable probably has something wrong in it. It is mean to be a bunch of folders that have programs you want to run, so you don’t have to specify their path when you run them. It should have a whole bunch of paths in it, not the location of your cmd.exe file.

Does that make sense?

I’m on windows 7
but yes cmd is in “C:\Windows\System32\cmd.exe”, and I get a huge list of paths when I run the command.

All seems in order looking at the list.

(off to bed, will be back tomorrow to check and test new suggestions)

Post the contents of the bat file if its not too big, need to figure out what lines are failing and why.

If you see @echo off at the start of the file, remove that. You will see the commands as they are executed, should also help troubleshoot the file/environment.

Hey, I’m currently away fromy PC for the next few days. But the bat file is the babun installer. Link here: https://github.com/babun/babun

I’ll have a look, see if I can install it in a vm. Windows 10 comes with a linux subsystem you can use, if that is all you want to achieve. It will even open an SSH port.

There is quite a lot going on in that bat file. It runs fine in my fresh windows 7 vm. If you want to know what exactly is going on, remove the echo off line, and from cmd.exe, run install.bat > log.txt.

Check the contents of log.txt, and see where the errors start happening, and what line is causing them. This may help figure out what environment variable is bad.

Check the list of environment variables from cmd by running set, as i mentioned above. If you are happy to paste the results from that in here, it might reveal what is wrong also. I can’t tell from what you have pasted so far though.