简体   繁体   中英

wmic process not working using staf

Why do I not get a proper list of processes below?
staf is running on remoteVM with correct trust levels.

[user@system ~]# staf remoteVM PROCESS START SHELL COMMAND "wmic process" WAIT RETURNSTDOUT STDERRTOSTDOUT
Response
--------
{
  Return Code: 0
  Key        : <None>
  Files      : [
    {
      Return Code: 0
      Data       :  ■C
    }
  ]
}

Went with this workaround ..

staf remoteVM PROCESS START SHELL COMMAND "WMIC /OUTPUT:C:\\ProcessList.txt PROCESS" WAIT RETURNSTDOUT STDERRTOSTDOUT
staf remoteVM PROCESS START SHELL COMMAND "type C:\\ProcessList.txt" WAIT RETURNSTDOUT STDERRTOSTDOUT

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM