I'm trying to issue the following command remotely:

netstat -ano > C:\output.txt

but cannot figure out how to do that with WMIC! Any idea?

I've got:

process call create netstat.exe 

working but I cannot figure out how to pass the -ANO nor the output. Help please :)

link|improve this question
feedback

1 Answer

When issuing remote commands, quote the entire string to execute, like:

wmic /node:remote_computer process call create "netstat.exe -ano > C:\output.txt"
link|improve this answer
You probably need to add a /output:stdout because it does not do this by default if you want the file on the remote computer (that is ambiguous in your question), or it will be a useless output file. It took me a long time with wmic to figure that out. – alharaka Sep 23 '11 at 8:00
To add to the question, id like the output to be redirected to the remote machine (the issuer). Thanks! – coddrego Sep 23 '11 at 15:29
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.