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

21,385

Solution 1

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

Solution 2

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

Share:
21,385
pradeep
Author by

pradeep

Updated on December 31, 2020

Comments

  • pradeep
    pradeep over 3 years

    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?