【问题标题】:How do i change the root folder that psexec.exe uses?如何更改 psexec.exe 使用的根文件夹?
【发布时间】:2014-12-26 10:26:47
【问题描述】:

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

psexec.exe \\192.168.13.187 -u Administrator -p default -d -i c:\temp\abc.bat

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

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

提前感谢您的帮助!

【问题讨论】:

    标签: windows batch-file cmd command-prompt psexec


    【解决方案1】:

    使用-wswitch卢克。

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

    【讨论】:

      猜你喜欢
      • 2020-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-25
      • 2013-02-12
      • 2012-02-16
      • 1970-01-01
      • 2011-08-03
      相关资源
      最近更新 更多