This may be a question for ServerFault but I was more interested in understanding the methodology that the OS uses to resolve relative paths. I have two VMware instances of Windows 2003. I am trying to run a batch file that starts running another batch file within its folder path. The script runs fine on one VM but on the other VM it fails to execute with the error:
> The System cannot find the file specified
The script I am trying to run is script.bat
:
start /d FOLDERNAME /b /WAIT AnotherScript.bat %~n0%~x0开发者_StackOverflow
I have put both my files within the same folder structure under the C:\ drive on both machines. The file AnotherScript.bat resides within FOLDERNAME on both the VMs.
It is not a permissions issue(?) since I show up as an administrator on both VMs.
I was wondering why would I get an unable to resolve relative paths on one machine vs. the ability to resolve it on another machine.
Thanks
First check if the folder in which both are lauching are the same. Try adding
ECHO %CD%
before calling the 2nd script to check the directory in which it is getting launched.Also check if the path where the 2nd bat file resides is set in the
%PATH%
variable in the 1st VM.Where does command prompt start by default in both VMs?
精彩评论