JakubPL 0 Posted December 4, 2020 Hi guys! Calling the below command from poweshell works flawlessly: PsExec.exe \\remote-server-name -u User -p Pass tasklist /FI "ImageName eq notepad.exe" > C:\tmp\notepad_tasks.txt When i try to call it form AutoIT script: RunWait("PsExec.exe \\remote-server-name -accepteula -u User -p Pass tasklist /FI ""ImageName eq notepad.exe"" > C:\tmp\notepad_tasks.txt") i keep getting this error: Quote ERROR: Invalid argument/option - '>'. Type "TASKLIST /?" for usage. tasklist exited on remote-server-name with error code 1. The below action works without any problems: RunWait("PsExec.exe \\remote-server-name -accepteula -u User -p Pass tasklist /FI ""ImageName eq notepad.exe"") Any suggestions on how to escape the sign '>' ? Share this post Link to post Share on other sites
Jos 2,210 Posted December 4, 2020 Try added the cmd prompt to allow for piping the STDOUT: RunWait(@comspec & " /c PsExec.exe \\remote-server-name -accepteula -u User -p Pass tasklist /FI ""ImageName eq notepad.exe"" > C:\tmp\notepad_tasks.txt") Jos 1 JakubPL reacted to this SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
JakubPL 0 Posted December 5, 2020 10 hours ago, Jos said: Try added the cmd prompt to allow for piping the STDOUT: RunWait(@comspec & " /c PsExec.exe \\remote-server-name -accepteula -u User -p Pass tasklist /FI ""ImageName eq notepad.exe"" > C:\tmp\notepad_tasks.txt") Jos Yessss! This solution is working. Thnak you very much foer your help!!! Share this post Link to post Share on other sites