Microsoft
Software
Hardware
Network
Question : Batch file syntax for "For" command
Hi,
I think this is simple for a batch file guru...
i have a batchfile where i add a computer name as the %1 variable after the filename like this:
Batchfile.bat Computername
Instead of computername, I want to have a list of computers to run this batch on..
computers are in a file called thelist.txt. batchfile.bat will vary, but something like
psexec.exe \\%1 -s msiexec.exe /x {guid}
so instead of one computer being listed as the %1 variable, I have a list of them in thelist.txt
and I would like the syntax to use for that, I'm assuming I guess that it will use the FOR command.
I hope that makes sense... Thanks !!!!
Answer : Batch file syntax for "For" command
I think in that case you could get away with something like this.
for /F "tokens=1" %%h IN (thelist.txt) Do psexec.exe \\%%h -s msiexec.exe /x {guid}
pause
Random Solutions
Flex CountDown Timer
Java Applet Server not starting
Exchange 2010. Install Failed, now can't uninstall
Citrix XenServer can't mount NFS share
BES and NSPI connections
Raid 1 Rebuild Failed - Adaptec 1210SA
Software for use with EE
Can't connect to local MySQL server through socket
I have an Exchange 2003 on a SBS2003 and I need it to handle 2 or more email domains
Error message when replying, sending, openning email in OWA