-1

这不起作用:

$server = "server";
$cmd = "hostname";
C:\Users\ss\Documents\Scripts\PSTools\PsExec.exe \\$server $cmd;

但这将:

$server = "server";
C:\Users\ss\Documents\Scripts\PSTools\PsExec.exe \\$server hostname;

为什么?

4

1 回答 1

0

尝试将 & 附加到命令的前面:

& C:\Users\ss\Documents\Scripts\PSTools\PsExec.exe \$server $cmd;

于 2012-04-29T22:48:09.097 回答