in reply to tasklist command not working
open (OLDOUT, ">&STDOUT"); open (STDOUT, ">c:\\Temp\\STDOut.txt") or die "Can't open STDOUT: $!"; print `tasklist /S 10.9.79.251 /U sagarkha /P ******`;
or possibly
print `tasklist /S 10.9.79.251 /U sagarkha /P ****** 2>&1`;
If, on the other had, you need to keep your error stream and output stream independent, you will need to do some interprocess communication -- see, for example, perlipc or IPC::Open3.
|
|---|