Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Dear people; anyone of you know how to write a batch file? I want a batch file to automatically download a file from a site at a given time even when the user is not at the pc!
Any ideas how to do that?
Regards
Chris Foo

As far as the time part no. I did create a batch file that is simple.
ftp -s:download.txt
Then create a txt file that is called Download.txt
the commands go like this:open ServerName.com
userid
password
dir
get filename.txt c:\location\filename.txt
dir
bye
I use it for our transferring of files here and it works great. The downside is people mess up the txt file all the time.Charlie

Hi Charlie & Chris,
::== getFILE.bat
@echo off> ft.do echo o mysite
>> ft.do echo username
>> ft.do echo password
>> ft.do echo bin
>> ft.do echo cd the-dir
>> ft.do echo get myFILE
>> ft.do echo byeftp -s:ft.do
:: DONESchedule the batch with AT.
If at first you don't succeed, you're about average.M2

Hi people! Sorry for my late reply.
I want the batch file to download updates from Symantec website. Eg: the virus definition/
I seem not able to get the batch file work.
Please help
Thanks
Regards
Chris Foo

"I seem not able to get the batch file work."
Well, that narrows it right down.
If at first you don't succeed, you're about average.M2

The problem is your command below when I put it into the notepad and save it as symantec.bat and run it, I seem to get the command wrong may be.
Let see: When I access symantec site then to the download section of the virus definition, there is the download link to it.
When I insert it into the batch file; it just seem not working.
Can you show me how to write one? May be I got wrong since I am new to batch file!
Regards
Chris Foo

What is the link to the file?
=====================================
If at first you don't succeed, you're about average.M2Go

This is actually the link but it followed by the date of the update available. I want the batch to be able to check the symantec virus definition site for any update then if have download it automatically.
http://definitions.symantec.com/defs/
Thanks pal
Regards
Chris Foo

Hi Chris,
That link was not found.
WEorse yet,
http://definitions.symantec.com
was not found.
Try again.
If at first you don't succeed, you're about average.M2

http://definitions.symantec.com/defs/20060410-007-i32.exe
here is the file
but I would like the batch to automatic check for update! So the file name at end change every time!
Regards
Chris Foo

Hi Chris,
That was also not found.
After spelunking for a while, I found a site where defs are available.
The batch below gets a list of files like this:
20060408-003-i32.exe
20060409-004-i32.exe
20060410-007-i32.exeIt's tempting to speculate that the 200604xx represents the date. [Call me crazy.]
If so, life gets easier.
::== LISTi32.bat
@echo off> ft.do echo o ftp.symantec.com
>> ft.do echo anonymous
>> ft.do echo m@nul.mx
>> ft.do echo bin
>> ft.do echo cd public
>> ft.do echo cd english_international
>> ft.do echo cd antivirus_definitions
>> ft.do echo cd norton_antivirus
>> ft.do echo dir *i32.exe
>> ft.do echo byeftp -s:ft.do
:: DONE
If at first you don't succeed, you're about average.M2

Hi mechanix2go, can you tell me how it works? Because I intend to use the batch file to look for update from my current deifintions. If old then the available update, it will download automatically but it seem when I put your command and save it into bat, it open and close. Nothing more.
Regards
Chris Foo

This assumes that the 200604xx indicates the file date.
::== getdef.bat
@echo off> ft.do echo o ftp.symantec.com
>> ft.do echo anonymous
>> ft.do echo m@nul.mx
>> ft.do echo bin
>> ft.do echo cd public
>> ft.do echo cd english_international
>> ft.do echo cd antivirus_definitions
>> ft.do echo cd norton_antivirus
>> ft.do echo dir *i32.exe
>> ft.do echo byeftp -s:ft.do>i32.tmp
find "i32.exe" <i32.tmp>i32.logfor /f "tokens=9" %%T in (i32.log) do echo %%T>>#
sort <#> #s
for /f "tokens=*" %%T in (#s) do set latest=%%Tif exist %latest% echo got it && goto :eof
> ft.do echo o ftp.symantec.com
>> ft.do echo anonymous
>> ft.do echo m@nul.mx
>> ft.do echo bin
>> ft.do echo cd public
>> ft.do echo cd english_international
>> ft.do echo cd antivirus_definitions
>> ft.do echo cd norton_antivirus
>> ft.do echo get %latest%
>> ft.do echo byeftp -s:ft.do
:: DONE
=====================================
If at first you don't succeed, you're about average.M2Go

Thanks a lot Mechanix2go you did it! This is exactly what I am looking for! Thanks a lot. Saves my time in visiting that page for download! Thanks!!
Regards
Chris Foo

![]() |
About short date format
|
VB.NET web browser+filter
|

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