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
PowerEdge 1950 - Hard Drive Upgrade - Server 2003 R2
How do I check if a window is already open or give it focus using Flex/Flash
How to connect Crystal Report to SQL database in .NET C#
jQuery script error in Firebug
#tables always in tempdb only?
Your message wasn't delivered because of security policies. Microsoft Exchange will not try to redeliver this message for you. Please provide the following diagnostic text to your system administrator
Always view the last row of a textarea box
Vlookup with exact number format
Newsletter emails stuck in qmail queue
Translate web site