0

这就是我通过运行命令的方式staf,但它似乎没有列出C:\Program Files
即使文件夹实际存在下的文件和文件夹.. 在此处输入图像描述

[root@server ~]# winPath="C:\Program Files"
[root@server ~]# staf remoteServer.com PROCESS START SHELL COMMAND 'dir "$winPath"' WAIT RETURNSTDOUT STDERRTOSTDOUT
Response
--------
{
  Return Code: 1
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       :  Volume in drive C has no label.
 Volume Serial Number is C052-46E0

 Directory of C:\Windows\system32

File Not Found

    }
  ]
}
4

1 回答 1

0

直接在命令中使用双引号的环绕路径有效..

[root@server ~]# staf remoteServer.com PROCESS START SHELL COMMAND 'dir "C:\Program Files\"' WAIT RETURNSTDOUT STDERRTOSTDOUT
Response
--------
{
  Return Code: 0
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       :  Volume in drive C has no label.
 Volume Serial Number is C052-46E0

 Directory of C:\Program Files\

05/15/2014  05:46 PM    <DIR>          .
05/15/2014  05:46 PM    <DIR>          ..
05/12/2014  01:47 PM    <DIR>          logs
05/06/2014  08:14 AM    <DIR>          properties
               7 File(s)    225,032,824 bytes
              24 Dir(s)  15,758,508,032 bytes free

    }
  ]
}
于 2014-05-23T11:23:44.523 回答