You are not logged in.
Pages: 1
Hi, I am trying to extract some info from remote machines usnig below script
for /f %%f IN (c:\host.txt) do echo Host Name = %%f >> c:\output.txt && systeminfo |find "OS Build Type" >> c:\output.txt
But the output.txt contains output from the Local machine and not from the remote however when run without sending output to the output.txt it gives the proper output but the same is not being written to the file.
Offline
you need to pass or pipe the host name into systeminfo /S
use a subroutine
for /f %%f IN (c:\host.txt) do (CALL :mysubroutine %%f )
...etc
Offline
As Simon intimated, you haven't told "systeminfo" to work against a remote system. Maybe this (untested)?
for /f %%f IN (c:\host.txt) do systeminfo /s %%f | findstr "^Host.Name: ^OS.Build.Type:" >> c:\output.txtOnline
Pages: 1