Computing.Net > Forums > Programming > batch file

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.

batch file

Reply to Message Icon

Name: Chris Foo
Date: March 29, 2006 at 08:29:33 Pacific
OS: win xp
CPU/Ram: 51
Product: HP
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: charlie1130s
Date: March 30, 2006 at 13:02:02 Pacific
Reply:

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


0

Response Number 2
Name: Mechanix2Go
Date: March 30, 2006 at 23:33:11 Pacific
Reply:

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 bye

ftp -s:ft.do
:: DONE

Schedule the batch with AT.


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

M2


0

Response Number 3
Name: Chris Foo
Date: April 5, 2006 at 06:03:55 Pacific
Reply:

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


0

Response Number 4
Name: Mechanix2Go
Date: April 5, 2006 at 23:19:41 Pacific
Reply:

"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


0

Response Number 5
Name: Chris Foo
Date: April 6, 2006 at 10:16:09 Pacific
Reply:

Hi Mechanix2Go; you got anymore brilliant idea to solve my problem??

Regards
Chris Foo


0

Related Posts

See More



Response Number 6
Name: Mechanix2Go
Date: April 6, 2006 at 13:03:42 Pacific
Reply:

Sure

But what didn't work?


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

M2


0

Response Number 7
Name: Chris Foo
Date: April 7, 2006 at 02:32:45 Pacific
Reply:

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


0

Response Number 8
Name: Mechanix2Go
Date: April 7, 2006 at 03:11:17 Pacific
Reply:

What is the link to the file?


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

M2Go



0

Response Number 9
Name: Chris Foo
Date: April 8, 2006 at 08:10:15 Pacific
Reply:

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


0

Response Number 10
Name: Chris Foo
Date: April 9, 2006 at 21:46:42 Pacific
Reply:

Hi there mechanix2go, any brilliant solution??

Regards
Chris Foo


0

Response Number 11
Name: Mechanix2Go
Date: April 10, 2006 at 03:22:19 Pacific
Reply:

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


0

Response Number 12
Name: Chris Foo
Date: April 10, 2006 at 11:28:26 Pacific
Reply:

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


0

Response Number 13
Name: Mechanix2Go
Date: April 10, 2006 at 12:58:04 Pacific
Reply:

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.exe

It'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 bye

ftp -s:ft.do
:: DONE



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

M2


0

Response Number 14
Name: Chris Foo
Date: April 11, 2006 at 05:37:35 Pacific
Reply:

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


0

Response Number 15
Name: Mechanix2Go
Date: April 11, 2006 at 10:12:51 Pacific
Reply:

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 bye

ftp -s:ft.do>i32.tmp
find "i32.exe" <i32.tmp>i32.log

for /f "tokens=9" %%T in (i32.log) do echo %%T>>#
sort <#> #s
for /f "tokens=*" %%T in (#s) do set latest=%%T

if 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 bye

ftp -s:ft.do
:: DONE



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

M2Go



0

Response Number 16
Name: Chris Foo
Date: April 11, 2006 at 21:52:04 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

About short date format VB.NET web browser+filter



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: batch file

Batch file to count a specific character in a www.computing.net/answers/programming/batch-file-to-count-a-specific-character-in-a/19751.html

FTP batch file www.computing.net/answers/programming/ftp-batch-file/9027.html

batch file www.computing.net/answers/programming/batch-file/13936.html