Computing.Net > Forums > Programming > Not sure my request can be done.

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.

Not sure my request can be done.

Reply to Message Icon

Name: aha
Date: May 21, 2008 at 22:58:17 Pacific
OS: Winxp
CPU/Ram: P4 2.2Ghz
Product: None
Comment:

Hi there,
I wonder if my request can be done in DOS script.

Description:
I want to download mcafee program to my harddisk.

The link is following.
http://www.mcafee.com/apps/download...

I want to download the EXE file named "5300xdat.exe(Windows-Intel)". I will use this file to scan other files. You know the file name is always changed by its serial number. The previous one is 5299xdat.exe. I
would like to download the latest one. Is that possible?

BTW, I tried to use Java and Perl to grab this page to get the filename, but failed because of its security.

Is there any way to run this script schedully
in Winxp and download the program automatically?


Thanks.

Phil

Computer Programmer



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: May 22, 2008 at 01:21:32 Pacific
Reply:

Assuming that the numbering scheme is consistent...

::== getmcaf.bat

:: get McCaffee

@echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%d in ('dir/b/on ????xdat.exe') do (
set latest=%%d
)
echo latest here is !latest!
set /a curr=!latest:~0,4!
set /a new=curr+=1
echo next number is !new!

echo wget http://download.nai.com/products/li...


::====


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

M2


0

Response Number 2
Name: aha
Date: May 22, 2008 at 16:10:39 Pacific
Reply:

Thank Mechanix2Go!

The files are not in my local PC. I can not run
"dir" to find the latest one in this way.

I have to install "mget" for windows to download the file.

Oh!! Can I run this script in FTP environment? Let me try. Maybe I run it in FTP.

Thanks again.

Regards,
Phil

Computer Programmer


0

Response Number 3
Name: aha
Date: May 22, 2008 at 16:23:52 Pacific
Reply:

Hi Mechanix2Go,

I tried to run it in FTP commands, but failed.
Quite different environment.

Thanks anyway.
I have to do to manually.

Phil

Computer Programmer


0

Response Number 4
Name: Mechanix2Go
Date: May 22, 2008 at 16:50:02 Pacific
Reply:

"The files are not in my local PC"

Where are they?

As to ftp, you can script that if McCaffee has a ftp site.


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

M2


0

Response Number 5
Name: aha
Date: May 22, 2008 at 19:38:26 Pacific
Reply:

Hi M2,
Please click the following link.
You will see the link of "5301xdat.exe(Windows-Intel)"

http://www.mcafee.com/apps/download...

That file is what I plan to download automatically. Sorry not explaining the question properly.

Another way is via FTP.
ftp://ftp.nai.com/virusdefs/4.x
Anonymous
That's why I tried to use FTP.

Do you have any suggestion?

Thanks.

Phil

Computer Programmer


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: May 22, 2008 at 21:08:13 Pacific
Reply:

Same question: if the old files are not on your drive, where are they?


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

M2


0

Response Number 7
Name: aha
Date: May 22, 2008 at 21:26:51 Pacific
Reply:

Hi M2,

The old file will be replaced by the newest one which is renamed as "antivirus.exe" in my PC. So only one file is there.

The whole diagram is like following.

[5301xdat.exe(Windows-Intel)]->Download from the Mcafee website->Save to c:\antivirus\5301xdat.exe
->Rename it as "antivirus.exe"->Done.

The most difficult one is xxxxxdat.exe.
I cannot grab the dynamic file name from there web page or ftp command.

Sorry confusing you before.

Thanks.
Phil

Computer Programmer


0

Response Number 8
Name: Mechanix2Go
Date: May 22, 2008 at 22:51:41 Pacific
Reply:

@echo off

setlocal enabledelayedexpansion

if exist antivirus.exe ren antivirus.exe antivirus.old

> s.ftp echo o ftp.nai.com
>> s.ftp echo anonymous
>> s.ftp echo anonymous
>> s.ftp echo cd virusdefs/4.x
>> s.ftp echo ls -l
>> s.ftp echo bye

ftp -s:s.ftp | find "xdat.exe" | find "-" > s.txt

for /f "tokens=4 delims= " %%e in (s.txt) do (
echo file to get is %%e
set new=%%e
)

> s.ftp echo o ftp.nai.com
>> s.ftp echo anonymous
>> s.ftp echo anonymous
>> s.ftp echo cd virusdefs/4.x
>> s.ftp echo bin
>> s.ftp echo get %new%
>> s.ftp echo bye

ftp -s:s.ftp

ren *.exe antivirus.exe


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

M2


0

Response Number 9
Name: aha
Date: May 23, 2008 at 17:56:01 Pacific
Reply:

Hi Mechanix2Go,

Thank you very much.
It works perfectly.

I do admire your programming ability and good personality. I did learn a lot from you.
I do appreciate your help.

Have a nice day.

Regards,
Phil

Computer Programmer


0

Sponsored Link
Ads by Google
Reply to Message Icon

Monitoring email traffic Current directory



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: Not sure my request can be done.

Check and compare Modified Date www.computing.net/answers/programming/check-and-compare-modified-date/10644.html

How to use a regular expression witihin batch www.computing.net/answers/programming/how-to-use-a-regular-expression-witihin-batch/19766.html

extract filename in batch + more www.computing.net/answers/programming/extract-filename-in-batch-more/11399.html