Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: "system cannot find the path specified" trying to run a .cmd from DOS

13 Jul 2015   #1
LoganTherrion

WIn 7 Enterprise
 
 
"system cannot find the path specified" trying to run a .cmd from DOS

Hi.

I'm using Win7 Enterprise.

I opened a DOS window as Administrator and I navigated to a directory with two files in it - someFile.cmd file and a someFile.jar file.

I typed this on the command line: someFile.cmd and I get, "The system cannot find the path specified". When I type someFile.jar and press Enter, I get no errors.

Just for fun I renamed the someFile.cmd to someFile.exe and tried to execute the someFile.exe from the same DOS window, and I got an error.

So for some reason, the DOS window has a hard time running the .cmd file. I even opened Windows Explorer and dragged the someFile.cmd into the DOS window and hit Enter, and that resulted in the same "cannot find the path specified" error. I'm pretty confidant it's related to the file's extension.

Does anyone know what's going on? This did not used to be a problem about a year ago (I haven't played with this since then) but it is now. And I do not know why or how to get around it.

Thanks in advance.

Logan


My System SpecsSystem Spec
.
13 Jul 2015   #2
MilesAhead

Windows 7 32 bit
 
 

In the Dos window type
path <Enter>

if none of the paths are dot '.' then it will not search the current directory unless it happens to be explicitly listed.

To add the dot, right click on Computer, click Advanced System Settings, click Environment Button. In user variables it should say Path. Edit it and put ".;" at the beginning so it will search the current directory first. Make sure there is only one semicolon between each path like
.;c:\users\joe;c:\windows\system32;yaddd yadda

note: the yadda yadda is optional.

How java does it I don't know. It may have its own path variable that always has the current directory first.
My System SpecsSystem Spec
13 Jul 2015   #3
LoganTherrion

WIn 7 Enterprise
 
 

Hey MilesAhead. Thanks for the lightning fast response.

Even if I am in the current directory and type the fully qualified path and filename (C:\folder\someFile.cmd), I still get the error.

Regardless, I updated my path statement so the first two chars are a dot and then a semi-colon. I then opened a new DOS window and tried navigating to the directory where my someFile.cmd lives, and tried to execute that, and got the same error.

For thoroughness - even though I'm in the dir with the file, I typed the fully qualified path to the .cmd file and hit enter and got the same error.

:/

Do you know of anything else I can try? This is pretty frustrating as it seems very inconsistent, given that it only throws that error on a particular type of file.
My System SpecsSystem Spec
.

13 Jul 2015   #4
LoganTherrion

WIn 7 Enterprise
 
 

The DOS window does recognize other .cmd files, just not the one I'm working with. I'll see if maybe it's just a corrupt .cmd file.
My System SpecsSystem Spec
13 Jul 2015   #5
MilesAhead

Windows 7 32 bit
 
 

What happens if you do
dir filename.cmd
??

does it show it existing?
My System SpecsSystem Spec
13 Jul 2015   #6
LoganTherrion

WIn 7 Enterprise
 
 

Ok. You're not going to believe this. I can't hardly believe this.

Please note that this behavior is very reproducible.

As mentioned, in the directory I'm using I have two files that I care about. One is the .cmd file, the other is a .jar file.

When my code runs, if the .jar file isn't there (renamed, removed, et al), the .cmd file can execute without the "system cannot find the path specified" error,BUT I do get an error that reads, "Didn't find drive:\folder\someFile.jar in directory drive:\folder.".
I don't know what to think of this. I've never seen anything like it before. I get the same results regardless of how I execute the .cmd file regarding the presence of the .jar file. It appears now as though the .jar file may be the monkey wrench in the works.

If the .jar file is renamed and I do a "dir someFile.cmd" I get File Not Found. If I rename it back to .jar and re-run the same command I get the same error - File Not Found.

Please tell me you have some more ideas here...


Logan



I sure hope you have some more ideas.
My System SpecsSystem Spec
13 Jul 2015   #7
Berton

Windows 7 Ultimate 64-bit, Windows 8.1 64-bit, Mac OS X 10.10, Linux Mint 17, Windows 10 Pro TP
 
 

Have you checked the properties of the .jar file to assure it's not marked as Hidden [Read-only shouldn't be a problem but wouldn't hurt to uncheck it also]? For a test have you tried changing the extension to .txt [about as simple file type there is]? Information about the .jar/Java Archive Files:
JAR File Extension - Open .JAR Files
My System SpecsSystem Spec
13 Jul 2015   #8
MilesAhead

Windows 7 32 bit
 
 

Or just do dir with attribute
dir /AH somefile.cmd
My System SpecsSystem Spec
13 Jul 2015   #9
LoganTherrion

WIn 7 Enterprise
 
 

I have checked the properties actually. They are neither hidden nor read only, and it's not blocked or anything. I have full control to the files and the directory they're in.

I got the same properties whether it was renamed to .txt or as a .jar. The .jar is 2.3M in size, and has no special permissions. And the properties are the same for each file.
My System SpecsSystem Spec
13 Jul 2015   #10
LoganTherrion

WIn 7 Enterprise
 
 

I tried your suggestion and did a dir /ah someFile.cmd and dir /ah someFile.jar, and in both instances I got "File Not Found".

If I rename either to .txt and do dir /ah someFile.<extension>, then I get expected output.
My System SpecsSystem Spec
Reply

 "system cannot find the path specified" trying to run a .cmd from DOS




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Open a new window with "full path" instead of Search Results\"Path"
How can I make it such that in Search Results, when I open a folder in a new window (by right-clicking a file), I will be directed to a window with the "full path" displayed in the address bar, instead of Search Results\"Path" or Search Results>"Path"? Edit: "Right-click -> open file location"...
General Discussion
System Image: "System cannot find the file specified (0x80070002)"
I have a Dell 2330 all-in-one running Win7 64 bit. I'm trying to do a system image back up to a USB3 external hard drive. The image will take up about 333gb and I have about twice that amount of space left on the 1 TB drive. I get the error message: System cannot find the file specified...
Backup and Restore
Cant find "System Image" of 36 GB but its shows on "Manage Disc Space"
Dear Experts, I have created windows image on Drive F: but delete it after some time manually due to some space prob. But while backup shows about 40 GB only few GB space got free after deletion. When i try to again take the the backup using windows 7 backup & restore option, its still shows 35...
Backup and Restore
Teracopy: "Open error: The system cannot find the path specified"
I'd like to use Teracopy for all copying etc. but after moving to 7 from xp it's giving me these errors. I have Win 7 Pro 64-bit. I copy from network drive for which I have read and write permissions as windows' own copy works fine. But with teracopy I immediately get error "Open error: The...
Software
"System Can't Find Path Specified" Error During Backup
I automatically back up my hard-drive weekly to an external drive. For several weeks I didn't notice that the capacity of my external drive had been exceeded. At that point I deleted several of the older data file backups, thus giving me ample space on the external drive to once again perform my...
Backup and Restore
"The system cannot find the file specified" Driver install
I recently purchased a wireless adapter for xbox 360. its not a genuine microsoft product. i have tried everything to install the driver but everytime it says "Windows found driver software for your device but encountered an error while trying to install it xbox360 wireless reciever for windows...
Drivers


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 16:20.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App