GeneralDzur
Technical User
I'm using a script to defragment a list of computers remotely. Right now, my script is a long list of "psexec" commands that start defrag.exe on each computer.
But I'd like for the script to read a list of computer names in a text file, instead of me having to manually make a list inside of the script.
Currently:
how can I have it read the list of computer names one-by-one from a text file??
I.E.
???
But I'd like for the script to read a list of computer names in a text file, instead of me having to manually make a list inside of the script.
Currently:
Code:
psexec -a 0 -belownormal -d \\computer1 defrag c: -f
psexec -a 0 -belownormal -d \\computer2 defrag c: -f
psexec -a 0 -belownormal -d \\computer3 defrag c: -f
<etc>...
how can I have it read the list of computer names one-by-one from a text file??
I.E.
Code:
for each %COMPUTERNAME% in %LIST_OF_NAMES%
psexec -a 0 -belownormal -d \\%COMPUTERNAME% defrag c: -f
???