Quantcast
Channel: Sysinternals Forums
Viewing all articles
Browse latest Browse all 10386

PsTools : Read comp name, username, passwrd from 1 text file

$
0
0
Author: rmetzger
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

Viewing all articles
Browse latest Browse all 10386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>