Solved How to feed a text file with computer names to a batch file?

August 29, 2016 at 06:44:27
Specs: Windows 7
I have a list of computers in a .txt file and I like to perform a set of tasks (batch file) on each of the computers in the text file. How do I accomplish that?

See More: How to feed a text file with computer names to a batch file?

Reply ↓  Report •


#1
August 29, 2016 at 08:39:56
What tasks would you like to perform?

Reply ↓  Report •

#2
August 29, 2016 at 09:39:20
I like to delete a bunch of directories on each workstation in the input text file. The text file has one machine name per line. Any help is greatly appreciated.

Reply ↓  Report •

#3
September 7, 2016 at 19:55:32
✔ Best Answer
This thread is kind of old...
set list=c:\list-of-computers
set delfils=c:\delfils
for /f "tokens=*" %%a in (%list%) do (
for /f "tokens=*" %%b in (%delfils%) do (
echo rd /s /q %%a\%delfils%
)
)
::---------- end snip

Reply ↓  Report •

Related Solutions


Ask Question