如何更改 psexec.exe 使用的根文件夹?

Yas*_*lir 1 windows cmd batch-file command-prompt psexec

我正在尝试使用 psexec.exe 在远程计算机上运行批处理文件
我的代码是;

psexec.exe \\192.168.13.187 -u Administrator -p default -d -i c:\temp\abc.bat
Run Code Online (Sandbox Code Playgroud)

但是当我在命令提示符下执行此操作时,它连接到远程服务器的 system32 文件夹然后启动批处理文件。问题是批处理文件中有一些 CALL 方法(如 CALL XXX.BAT)(XXX.BAT 文件在同一个文件夹。)由于psexec.exe 使用system32 文件夹作为根路径,因此在成功运行c:\temp\abc.bat 文件后,它无法调用其他批处理文件。抛出'找不到指定的文件'..

我的问题是;连接远程计算机后,如何使用远程 C:\temp\ 文件夹作为根路径?

提前感谢您的帮助!!

npo*_*aka 6

使用-w 开关卢克。

-w directory Set the working directory of the process (relative to the remote computer).