# How to deal with compound command lines with RunProcess?

Given Windows DOS command input:

tasklist|find /i "explorer.exe"


How to pass it to RunProcess or similar function and get the output?

RunProcess does not run shell commands (things you might type into your terminal). It runs processes, as the name suggests.
• Run (it does not give you the output)
• Import["!yourcommand", "String"] or similar (to get the output)
• Run your shell with RunProcess/StartProcess and pass the commands to it on its standard input. StartProcess has an example like this.
• For this specific task, run cmd.exe with the /c flag and tell it what to execute. RunProcess has an example like this.
• Thanks! but why RunProcess[{"cmd", "/c", " tasklist | find /i \"explorer.exe\""}] does not work? – Jerry Nov 22 '18 at 10:00
• Import["! tasklist | find /i \"explorer.exe\"", "String"] works! ;) – Jerry Nov 22 '18 at 10:02
• It's already solved using Import, thanks for help! – Jerry Nov 22 '18 at 10:14