Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a batch file through command prompt - system cannot find the path specified

I am trying to uninstall Oracle on this Windows 7 (64 bit) machine by downloading a standalone tool from Oracle, I need to run a batch file that is supposed to uninstall but I am unable to run it.

I tried to open command prompt as administrator and I am trying to run this as below: enter image description here

As you can clearly see from the screenshot, I am doing a "dir" on the directory and can clearly see the file right there. Not sure what's going on here.

I also tried to run the batch file by double clicking from Windows Explorer and a terminal window opens and closes quickly but the batch file is not doing what it is supposed to do (it is clearly not executing from Windows Explorer).

Can anyone help me with this?

like image 530
pradeep Avatar asked Jun 16 '16 14:06

pradeep


People also ask

What does it mean system Cannot find the path specified?

A Command-line Interface shows the “The system cannot find the path specified” error when it can't find the folder that a code is trying to access. It can happen in Windows CLIs like Command Prompt or IDE consoles for various programming language software.

What is path in batch file?

The Path variable holds the names of folders that are searched if the file being executed is not in the default folder at the command prompt. For example, if all the batch files are in C:\BATCH, and c:\batch is added to the Path environment variable, that batch file can be run from any command prompt.


2 Answers

As theB pointed out above in a comment, this worked for me:

Open the bat file in notepad. I'll bet it starts with @echo off, and that the error is actually coming from inside the batch file. The error if the batch file itself wasn't found is 'X' is not recognized as an internal or external command, operable program or batch file

like image 50
pradeep Avatar answered Oct 04 '22 15:10

pradeep


'Run as Administrator' changes the current directory. See my answer here Difference between "%~dp0" and ".\"?

like image 22
RGuggisberg Avatar answered Oct 04 '22 15:10

RGuggisberg