Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

Assuming that the numbering scheme is consistent...
::== getmcaf.bat
:: get McCaffee@echo off
setLocal EnableDelayedExpansionfor /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

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,
PhilComputer Programmer

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

"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

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

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

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.
PhilComputer Programmer

@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 byeftp -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 byeftp -s:s.ftp
ren *.exe antivirus.exe
=====================================
If at first you don't succeed, you're about average.M2

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,
PhilComputer Programmer

![]() |
Monitoring email traffic
|
Current directory
|

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