running defrag via psexec

By Bowen1973 ·
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.


This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Answers

Related Discussions

Related Forums