PC Review


Reply
Thread Tools Rate Thread

Command-line file downloader

 
 
Rich Pasco
Guest
Posts: n/a
 
      3rd May 2007
I am looking for a Win32 command-line (console) utility, suitable for
being driven from a BAT script, which accepts as input a URL and then
downloads the referenced web page (or other file) to my local disk.

The effect that I want to produce is exactly that I would get by right-
clicking on a link in a web browser and choosing from the popup menu
"save link target as..." except this one would be driven entirely from
the command line, without graphics, popups, or point-and-click.

I began to write my own, but it's harder than it looks; it involves
parsing the URL from the command line, to get the host name, issuing a
DNS query to get its IP address, opening a socket and speaking HTTP
to request the file, then interpreting the HTTP reply to reconstruct
the file and save it locally.

Might be easier if someone else has already done it.

Any suggestions?

- Rich






 
Reply With Quote
 
 
 
 
foxidrive
Guest
Posts: n/a
 
      3rd May 2007
On Thu, 03 May 2007 01:05:22 -0400, Rich Pasco <(E-Mail Removed)>
wrote:

>I am looking for a Win32 command-line (console) utility, suitable for
>being driven from a BAT script, which accepts as input a URL and then
>downloads the referenced web page (or other file) to my local disk.


WGET
 
Reply With Quote
 
Olof Lagerkvist
Guest
Posts: n/a
 
      3rd May 2007
foxidrive wrote:

> On Thu, 03 May 2007 01:05:22 -0400, Rich Pasco <(E-Mail Removed)>
> wrote:
>
>
>>I am looking for a Win32 command-line (console) utility, suitable for
>>being driven from a BAT script, which accepts as input a URL and then
>>downloads the referenced web page (or other file) to my local disk.

>
>
> WGET



Download: http://UnxUtils.sourceforge.net

--
Olof Lagerkvist
ICQ: 724451
Web: http://here.is/olof
 
Reply With Quote
 
Rich Pasco
Guest
Posts: n/a
 
      3rd May 2007
foxidrive wrote:

> On Thu, 03 May 2007 01:05:22 -0400, Rich Pasco <(E-Mail Removed)>
> wrote:
>
>>I am looking for a Win32 command-line (console) utility, suitable for
>>being driven from a BAT script, which accepts as input a URL and then
>>downloads the referenced web page (or other file) to my local disk.

>
> WGET


Thank you! I found it at http://www.gnu.org/software/wget/wget.html

- Rich
 
Reply With Quote
 
Stefan Kanthak
Guest
Posts: n/a
 
      3rd May 2007
"Rich Pasco" <(E-Mail Removed)> schrieb:

> I am looking for a Win32 command-line (console) utility, suitable for
> being driven from a BAT script, which accepts as input a URL and then
> downloads the referenced web page (or other file) to my local disk.


Microsoft's BITSAdmin.exe controls the built-in BITS, but is restricted
to http.
If you want a more versatile utility, then get cURL http://curl.haxx.se/;
it's "better" than WGET.

Stefan

 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      3rd May 2007
In microsoft.public.win2000.cmdprompt.admin, Rich Pasco wrote:

> foxidrive wrote:
>
>> On Thu, 03 May 2007 01:05:22 -0400, Rich Pasco
>> <(E-Mail Removed)> wrote:
>>
>>>I am looking for a Win32 command-line (console) utility,
>>>suitable for being driven from a BAT script, which accepts as
>>>input a URL and then downloads the referenced web page (or
>>>other file) to my local disk.

>>
>> WGET

>
> Thank you! I found it at
> http://www.gnu.org/software/wget/wget.html



Here are two more links to round it out.

http://xoomer.alice.it/hherold/

http://users.ugent.be/~bpuype/wget/ (win32 only)
 
Reply With Quote
 
Rich Pasco
Guest
Posts: n/a
 
      3rd May 2007
Stefan Kanthak wrote:

> Microsoft's BITSAdmin.exe controls the built-in BITS, but is restricted
> to http.


I found information about it here:
http://msdn2.microsoft.com/en-us/library/aa362813.aspx

> If you want a more versatile utility, then get cURL http://curl.haxx.se/;
> it's "better" than WGET.


In what way is it "better"? WGET is already working perfectly in my script.

- Rich
 
Reply With Quote
 
Mark Blain
Guest
Posts: n/a
 
      3rd May 2007
Rich Pasco <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

> Stefan Kanthak wrote:
>
>> If you want a more versatile utility, then get cURL
>> http://curl.haxx.se/; it's "better" than WGET.

>
> In what way is it "better"? WGET is already working perfectly in my
> script.


There's a feature comparison of several command-line downloading tools
including cURL and wget at
http://curl.haxx.se/docs/comparison-table.html
 
Reply With Quote
 
Jason Gurtz
Guest
Posts: n/a
 
      4th May 2007
Mark Blain wrote:
> There's a feature comparison of several command-line downloading tools
> including cURL and wget at
> http://curl.haxx.se/docs/comparison-table.html


The lack of recursive downloading is a pretty significant hit against
curl. FWIW, the comparison table also barely scratches the features of
wget.

It appears the main advantage of curl is support for a small handful of
additional protocols. IMO to issue a blanket statement that it is carte
blanch better than wget is pretty bold. That said, curl is a pretty
great choice.

Maybe more important is the related curl library for programming projects

It also might be worth taking a look at the ncftp package. In addition
to the interactive commandline ftp client, there is also the scriptable
ncftpput and ncftpget included (of course it is ftp only).

Good luck in all automated file transfer projects...

~Jason
 
Reply With Quote
 
Mark Blain
Guest
Posts: n/a
 
      5th May 2007
Jason Gurtz <(E-Mail Removed)> wrote (in part):

> It appears the main advantage of curl is support for a small handful
> of additional protocols. IMO to issue a blanket statement that it is
> carte blanch better than wget is pretty bold...


For the record Stefan said that, not me. You're correct that the
comparison table I suggested is incomplete, but it's a good place to start.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't create text file by command line command. Boki Digtal Microsoft C# .NET 1 23rd Jul 2007 07:26 AM
Is there a command line command to extract just the files within a .msi file. Lawrence Windows XP General 5 4th Nov 2004 04:27 AM
Is there a command line command to extract just the files within a .msi file. Lawrence Microsoft Windows 2000 5 4th Nov 2004 04:27 AM
Command line error D2016 : '/RTC1' and '/clr:initialappdomain' command-line options are incompatible Lars Grøtteland Microsoft Dot NET Framework 1 15th Oct 2003 09:35 AM
pipe file input into command line command Roger Johnson Microsoft Windows 2000 CMD Promt 0 1st Aug 2003 11:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:54 PM.