Computing.Net > Forums > Programming > search for a file in website n dnld

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.

search for a file in website n dnld

Reply to Message Icon

Name: alwaysk2
Date: January 12, 2009 at 19:48:00 Pacific
OS: Windows 2000 Server
CPU/Ram: 8 GHZ
Product: Ibm / BLADE
Subcategory: Batch
Comment:

hi,

I am making a batch file which will download two virus definition files from symantec's website and will download both the files but the problem is I don't know how to tell the batch file that download these files only as file names gets changed daily according to date in YYYYMMDD format. you can have a look at the webpage
hxxp://definitions.symantec.com/defs/

ya I need to download -x86.exe file and .xdb file daily.

Kindly guide me further.
thanks

K2™
System/Network Engineer



Sponsored Link
Ads by Google

Response Number 1
Name: Holla
Date: January 12, 2009 at 20:19:11 Pacific
Reply:

hi K2,
Based on your date format, use string
manupulation functions to form the filename.
Ex: In my machine,

c:\holla>echo %date%
13-01-2009

c:\holla>echo %date:~-4%
2009

c:\holla>echo %date:~,2%
13

c:\holla>echo %date:~3,2%
01

c:\holla>ver

Microsoft Windows [Version 6.0.6001]

c:\holla>

Use the above to form the file name. And then use wget to get the file from hxxp://definitions.symantec.com/defs/........

.... Trust you get the idea.

--
Holla.


0

Response Number 2
Name: Mechanix2Go
Date: January 13, 2009 at 04:02:29 Pacific
Reply:

Didn't we go through this a couple months ago?

BTW, this is not a useable link on this site:

hxxp://definitions.symantec.com/defs/

Rather than mickey-mouse the date, what you probably need is the latest x86.exe & .xdb.

[Why would you want an out of date file?]


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

M2


0

Response Number 3
Name: alwaysk2
Date: January 13, 2009 at 04:42:02 Pacific
Reply:

mechanix i do always need latest updates, i daily needs those files, but daily i always have to download those files and have to update it onto 17 different servers which is very time consuming task so I want to make it totally automated by batch file which will daily download the latest updates files and will apply those downloaded file onto the servers. but I tried the wget and url2file utilities as they are not working at all.

K2™
System/Network Engineer


0

Response Number 4
Name: Mechanix2Go
Date: January 14, 2009 at 08:07:56 Pacific
Reply:

This should get you the latest x86.

=========================================
@echo off & setLocal EnableDelayedExpansion

> #.ftp echo o ftp.symantec.com
>> #.ftp echo anonymous
>> #.ftp echo password
>> #.ftp echo bin
>> #.ftp echo cd AVDEFS
>> #.ftp echo cd norton_antivirus
>> #.ftp echo ls
>> #.ftp echo bye

ftp -s:#.ftp > symlist

for /f "tokens=* delims= " %%a in ('find /i "x86" ^< symlist ^| sort') do (
set NEWEXE=%%a
)

set NEWEXE=!NEWEXE:~0,-1!

> #.ftp echo o ftp.symantec.com
>> #.ftp echo anonymous
>> #.ftp echo password
>> #.ftp echo bin
>> #.ftp echo cd AVDEFS
>> #.ftp echo cd norton_antivirus
>> #.ftp echo get !NEWEXE!
>> #.ftp echo bye

ftp -s:#.ftp


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

M2


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


stuck in DOS batch wait n secs for use...



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: search for a file in website n dnld

Scripts to search for a text in a view source www.computing.net/answers/programming/scripts-to-search-for-a-text-in-a-view-source/19961.html

Search for a folder in any drive www.computing.net/answers/programming/search-for-a-folder-in-any-drive/16117.html

Need program to scan for a file ..... www.computing.net/answers/programming/need-program-to-scan-for-a-file-/19026.html