Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB SCRIPT to do something similar 1

Status
Not open for further replies.

brodie1227

Vendor
Feb 19, 2004
76
US
O.K. Does someone have a script for something like this.

I am trying to have a script automatically launch at a certain time to go out to nortons web site, and automatically download the new updates and create some kind of txt log with the info once completed with no user intervention. Thanks tek-tippers for taking the time to read this thread! Any suggestions are appreciated.
 
Why not simply rely on LiveUpdate ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I should mention that I want it to run in the background with no intervention on the monitor. I would just like to check the log or text file that is produced to see what updates have been installed. Thanks for the reply.
 
I was wanting this to runin the background and not ever see it. I just want to look at the text file to see what if any updates were installed when the script ran.
 
I do it now in a DOS window, on W2k machines. I run it thru scheduler 2x daily, including w/e, so the NAV defs get updated without my intervention. It involves an FTP script. If you're interested, I'll send it to you. I'm still working on converting it to VBS. Maybe you can do better at that part than I have so far.
 
You can search Syamntec for the word "CEGETTER," and read more details on why this works.

First, create this text file somewhere on the hard drive (I use the C: root). You will use this file to open an automated FTP session with Symantec. This FTP will produce a list of available NAV defs at Symantec, and save it into the "NAVLIST.TXT" file on the local hard drive.

****************
open ftp.symantec.com
anonymous
nobody@spammer.com
cd public/english_us_canada/antivirus_definitions/norton_antivirus
lcd f:\definitions
bin
prompt
ls *-i32.exe navlist.txt
quit

****************

Next, create a batch script like this next one. This launches the FTP session using the commands list you just created (the "ftp -s:i32list.txt" refers to the text file you created, so match up your filenames and paths). Then, after capturing the candidate list of NAV defs in NAVLIST.TXT, it riffles thru the list one at a time, setting the navname variable to whatever it reads on each line. The last name it reads becomes the working variable %navname%. Then, it checks a list (i32dload.txt) created each time this is run to see if you have already downloaded the currently available NAV def. Obviously, the first time you run this, i32dload.txt doesn't exist, so it continues past that point.

It then uses ECHO to create the i32dload.txt file, populating it with the FTP command stream to access the Symantec site, and download %navname%.

"ftp -s:i32dload.txt" runs the FTP session with the i32dload.txt file just created, and saves the NAV executable to the local harddrive.

"dir /b /o:s *-i32.exe>navsize.txt" and the two lines that follow are my way of checking download quality, something FTP can't do conveniently. This works because I keep the last two NAV def files that I have downloaded. This is necessary because my site only guarantees possible line flakiness, they don't mention quality. Assuming that each successive NAV defs file is a few KB larger than the previous one, then a list of these defs sorted on size would place the file that you just downloaded as the last (largest) one on the list.

Finally, I run the NAV file just downloaded, with the "/q" switch. This, of course, does the actual update to the NAV engine silently and invisibly. At this site, the whole process takes about 3 minutes or less at my central server. Then I push the defs file to each of my clients, and also push the "start /wait c:\%navname% /q" command as a command to the clients. None of my client machines has access to the internet, so that's why I run it cntrally, but this would work on each individual machine just as well, except that the user would see the DOS window while it runs.

****************

C:
cd \

ftp -s:i32list.txt
for /f %%a in (navlist.txt) do set navname=%%a
if exist i32dload.txt @type i32dload.txt | find /i "%navname%" && goto END

@echo open ftp.symantec.com> i32dload.txt
@echo anonymous>> i32dload.txt
@echo nobody@spammer.com>> i32dload.txt
@echo cd public/english_us_canada/antivirus_definitions/norton_antivirus>> i32dload.txt
@echo lcd c:\
@echo bin>> i32dload.txt
@echo prompt>> i32dload.txt
@echo get %navname%>> i32dload.txt
@echo quit>> i32dload.txt

ftp -s:i32dload.txt

dir /b /o:s *-i32.exe>navsize.txt
for /f %%a in (navsize.txt) do set navnam=%%a
if %navname% NEQ %navnam% goto end

@echo NAV update started with %navname% %date% %time% >> Navtimes.txt

start /wait c:\%navname% /q

:END

****************

As I said, I haven't learned enough about VBS to script this, except by shelling out. That seems kind of crude. If you come up with something more elegant, I'd like to hear about it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top