Computing.Net > Forums > Programming > download/update script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

download/update script

Reply to Message Icon

Name: enigmafyv
Date: June 23, 2005 at 00:10:38 Pacific
OS: WinXP SP2
CPU/Ram: P4/3.06Ghz 512PC3200
Comment:

I'm currently trying to automate my updates for virus scanners, specifically Norton Antivirus. My objective is to download, via ftp (using wget.exe) the latest Intelligent Updater antivirus definitions. Then extract the defenitions, only from the latest file, to another directory.

My current script looks like this (please keep in mind, I'm an amature scripter):

-
wget ftp://ftp.symantec.com/public/english_us_canada/antivirus_definitions/norton_antivirus/2005*-
i32.exe -N

2005*-i32.exe /extract c:\norton\virusdef
-

Well my dilema is, by performing this form of download of the antivirus definitions, there are usually more than one file that gets downloaded. So by using the wildcard "*" to execute the extraction process, it doesn't know what file to extract from, say if there were three files that matched "2005*-i32.exe".

So what I'm looking for is a way to run a batch script that will pinpoint the latest of these executable files, set that filename as a variable, then use that variable to extract the definitions to the folder of my liking.

Example:
wget <filename>
find latest <filename>
set latest <filename> = variable
variable /extract <location of my choice>

Do not know if this is possible, but I figured I would ask.

Thanx,

Enigmafyv



Sponsored Link
Ads by Google

Response Number 1
Name: enigmafyv
Date: June 23, 2005 at 00:16:49 Pacific
Reply:

Oh, one other thing that I forgot to mention. I only want to cache the latest three Intelligent Updater antivirus definition files, anything earlier I would like the script to verify and delete. If this could be figured in at the same time, I'd be grateful.

Enigmafyv


0

Response Number 2
Name: Mechanix2Go
Date: June 23, 2005 at 00:58:32 Pacific
Reply:

If Symantec is as sensible as we hope, the file names will reflect their relative ages.

2005*-i32.exe

Maybe the files you get will be:

20050202-i32.exe
20050411-i32.exe
20050525-i32.exe

In that case you can:

for %%E in ('dir /b/on 200*.exe) do set latest=%%E

HTH

M2


If at first you don't succeed, you're about average.


0

Response Number 3
Name: enigmafyv
Date: June 25, 2005 at 00:27:46 Pacific
Reply:

Here are the results of running this batch. It doesn't seem as though it worked. Or maybe I'm wrong and I really don't know what I'm doing.

result:
C:\folder\folder>for %E in ('dir /b/on 200*.exe) do set latest=%E

C:\folder\folder>set latest='dir

C:\folder\folder>set latest=/b/on

C:\folder\folder>set latest=20050620-007-i32.exe

C:\folder\folder>set latest=20050621-008-i32.exe

C:\folder\folder>set latest=20050622-017-i32.exe

C:\folder\folder>set latest=20050623-007-i32.exe


0

Response Number 4
Name: Mechanix2Go
Date: June 25, 2005 at 01:22:34 Pacific
Reply:

Hi,

Sorry. My mistake.

I left out two things.

Try this:

for /f %E in ('dir /b/on 200*.exe') do set latest=%E

M2


If at first you don't succeed, you're about average.


0

Response Number 5
Name: enigmafyv
Date: June 26, 2005 at 19:25:22 Pacific
Reply:

What do I do with the output, how do I use it?


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: June 26, 2005 at 22:41:09 Pacific
Reply:

It sets the variable "latest" to the name of the latest EXE file.

So you could:

COPY %latest% c:\work\

or something similar.

M2


If at first you don't succeed, you're about average.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: download/update script

Hiding Download Link Script www.computing.net/answers/programming/hiding-download-link-script/13772.html

Batch file to copy update file www.computing.net/answers/programming/batch-file-to-copy-update-file/15582.html

ASP Script?? www.computing.net/answers/programming/asp-script/7695.html