Batch file guru needed
#1
Scooby Regular
Thread Starter
I need to create a batch command that will read a text file (list of computer names) and run a REG command for each of the computer names and pipe the output to a results file.
Basically, what I need is to capture the results of these two commands for every PC on our network.
REG QUERY "\\COMPUTER\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szDatVersion
REG QUERY "\\COMPUTER\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szEngineVer
I'd like the output to be in the format <NAME> <DAT> <ENGINE>, like this:-
COMPUTER1 4214 1254
COMPUTER2 4221 1236
COMPUTER3 7823 9685
and so on .........
Stefan
Basically, what I need is to capture the results of these two commands for every PC on our network.
REG QUERY "\\COMPUTER\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szDatVersion
REG QUERY "\\COMPUTER\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szEngineVer
I'd like the output to be in the format <NAME> <DAT> <ENGINE>, like this:-
COMPUTER1 4214 1254
COMPUTER2 4221 1236
COMPUTER3 7823 9685
and so on .........
Stefan
#3
You need to do something with a FOR command e.g.
for /F %1 in (****.txt) do spver.bat %1 >> splist.txt
------------
and spver.bat would be your reg query e.g.
reg query "HKLM\software\microsoft\Windows NT\currentversion\csdversion" %1
for /F %1 in (****.txt) do spver.bat %1 >> splist.txt
------------
and spver.bat would be your reg query e.g.
reg query "HKLM\software\microsoft\Windows NT\currentversion\csdversion" %1
#5
Scooby Regular
Join Date: Dec 2001
Location: Sutton, Surrey
Posts: 536
Likes: 0
Received 0 Likes
on
0 Posts
I'll take a stab at it.
for /F %%p in (pclist.txt) do (
ECHO.%%p >> output.log
REG QUERY "\\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szDatVersion \\%%p >> output.txt
REG QUERY "\\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szEngineVer \\%%p >> output.txt
)
place this .bat in a folder with a text file with your machine names called pclist.txt and the reg.exe. Not sure the output format will be what you want though.
I use a similar script to update registry winlogon entries to groups of machines.
[Edited by Jodster - 3/26/2003 12:18:07 PM]
for /F %%p in (pclist.txt) do (
ECHO.%%p >> output.log
REG QUERY "\\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szDatVersion \\%%p >> output.txt
REG QUERY "\\HKLM\SOFTWARE\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx" /v szEngineVer \\%%p >> output.txt
)
place this .bat in a folder with a text file with your machine names called pclist.txt and the reg.exe. Not sure the output format will be what you want though.
I use a similar script to update registry winlogon entries to groups of machines.
[Edited by Jodster - 3/26/2003 12:18:07 PM]
#6
Scooby Regular
Join Date: Nov 2001
Location: Leeds - It was 562.4bhp@28psi on Optimax, How much closer to 600 with race fuel and a bigger turbo?
Posts: 15,239
Likes: 0
Received 1 Like
on
1 Post
why not just use kix login scripts to log the information to a file stored on a server??
Then if the version was different to the version on another share you could run an update..
David
Then if the version was different to the version on another share you could run an update..
David
#7
Scooby Regular
Thread Starter
The client workstations are all configured to run an automatic DAT update. The problem is the engine doesn't get automatically updated by the NAI console.
I'll have a look at the Kix stuff to see if it's a better method of identifying who's up-to-date and who isn't. From doing some spot checks it looks like all the NAI 4.5.1 clients are updating properly, but the Vscan 6 & 7 clients aren't.
Just want to run some reports to identify where the problem clients are.
Keep the ideas coming lads,
Stefan
I'll have a look at the Kix stuff to see if it's a better method of identifying who's up-to-date and who isn't. From doing some spot checks it looks like all the NAI 4.5.1 clients are updating properly, but the Vscan 6 & 7 clients aren't.
Just want to run some reports to identify where the problem clients are.
Keep the ideas coming lads,
Stefan
Trending Topics
Thread
Thread Starter
Forum
Replies
Last Post
robbie1988
Wanted
2
13 September 2015 09:25 AM
Scooby-Doo 2
Wheels And Tyres For Sale
1
09 September 2015 06:51 PM