Read from Text file with Batch Script
I have this Script that adds a printer to a computer named Windows7.
The Script is good when you run it against one computer, but when you have many computers, you will have to change the computer name inside the Script for every computer your run the script against.
I would like to have this script gets the computer name from a separate text file.
@echo starting pnpport
cscript.exe "C:\windows\system32\Printing_Admin_Scripts\en-US\prnport.vbs" -a -s windows7 -r "printer1" -h hostname -o raw -n 9100
@echo Waiting 5 seconds
@echo starting setting MyPrinter
cscript C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -a -p "Myprinter" -m "Generic / text only" -r "printer1" -s windows7