Author: rmetzger
Subject: Read comp name, username, passwrd from 1 text file
Posted: 30 April 2015 at 10:07am
Assuming:
Try:
for /f "tokens=1-2*" %%A in (hostname.txt) do (
psexec \\%%A -u DOMAIN/%%B -p %%C cmd.exe /c cscript \\%%A\c$\wmi.vbs
)
The tokens parameter (1-2* or 1-3) would give you the %%A, %%B, and %%C values by first, second, and third words respectively, of the line, where each word is delimited by spaces.
Let us know if this works.
Ron Metzger
Subject: Read comp name, username, passwrd from 1 text file
Posted: 30 April 2015 at 10:07am
Assuming:
hostname.txt
servername1 admin password
servername2 admin2 password2
Try:
for /f "tokens=1-2*" %%A in (hostname.txt) do (
psexec \\%%A -u DOMAIN/%%B -p %%C cmd.exe /c cscript \\%%A\c$\wmi.vbs
)
The tokens parameter (1-2* or 1-3) would give you the %%A, %%B, and %%C values by first, second, and third words respectively, of the line, where each word is delimited by spaces.
Let us know if this works.
Ron Metzger