开发者

Problem with relative paths(*.bat + VMWARE + Windows 2003)

开发者 https://www.devze.com 2023-02-08 14:17 出处:网络
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 t

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


  1. 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.

  2. Also check if the path where the 2nd bat file resides is set in the %PATH% variable in the 1st VM.

  3. Where does command prompt start by default in both VMs?

0

精彩评论

暂无评论...
验证码 换一张
取 消