running defrag via psexec - TechRepublic
Question
June 10, 2009 at 06:44 AM
bowen1973

running defrag via psexec

by bowen1973 . Updated 16 years, 8 months ago

I am using psexec to run a remote command to defrag computers on our network, but i want the output into a text file so i can review them afterwards instead of watching the screen run. the problem i have is that the .txt file will be overwritten each time it starts a defreag on a new machine.

How can i get it to name the text file the same name as the computername?? i have tried %computername% but this just save the file as the local compuer name….

‘psexec @computerlist.txt -u username -p password Defrag c: /f >%computername%.txt’

Please help.

thanks

This discussion is locked

All Comments