Reputation: 61
@echo off
wmic /node:"computer" /user:myusername /password:"password" product get name > log.txt
how do i get ip's form a file and input it in node?
127.0.0.1
more ips here ...
ip.txt^
username and password is the same for all the pc's im trying to reach.
i understand how the batch file can read form file, but i dont understand how to input it in the node.
for /f "tokens=*" %%a in (ip.txt) do (
echo line=%%a )
might be a stupid question but,
for /f "tokens=*" %%a in (ip.txt) do (
)
wmic /node:%%a /user:myusername /password:"password" product get name > log.txt
just leave a comment if i formulated the question wrong.
ps: deleted old one
edit:
for /f "tokens=*" %%a in (ip.txt) do (
wmic /node:%%a /user:myusername /password:"password" product get name > log.txt
)
like this ^ ?
edit edit: if i want to get more info from this command like graphics card, ram and sutch.
wmic /FAILFAST:ON /node:@ip.txt /user:username /password:password path Win32_VideoController get Name >> log.txt
to get the graphics card info, do i need an other line and change the get command or can i get a lot of info in one line ?
mabye like
wmic /FAILFAST:ON /node:@ip.txt /user:username /password:password path Win32_VideoController get Name,product get name, MEMORYCHIP get BankLabel,DeviceLocator,Capacity,Tag >> log.txt
if that makes sense
Upvotes: 3
Views: 8985
Reputation: 109
Ah it's much simpler than that, my friend: http://ss64.com/nt/wmicglobal.html and http://ss64.com/nt/wmic.html
You can specify a file for wmic to operate against in the node argument:
@echo off
wmic /node:@ip.txt /user:myusername /password:"password" product get name > log.txt
Upvotes: 2