Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to know if there is a utility built-in to Windows Server 2003 that I can use from the command line to download a file using only one command.
Basically I know that I can download from ftp using the ftp utility but in order to do that I need to do first ftp open and then pass the other commands so it doesn't help me because I need to do perform the download only from one command. The download may be performed through http, ftp or any other protocol.

OS Name: Microsoft(R) Windows(R) Server 2003 Enterprise x64 Edition
OS Version: 5.2.3790 Service Pack 2 Build 379
share|improve this question

5 Answers 5

Nothing built-in I'm aware of. If you have PowerShell installed you can use System.Net.WebClient for that, even though you may still want a wrapper for ease of use:

$wc = New-Object Net.WebClient
$wc.DownloadFile('http://...', file)

But if you first need to install something, then there are many other options out there, too.

share|improve this answer

The Windows ftp client can use batch files in non-interactive mode.

Create a plain-text file named sitename.scr containing the syntax below. This example connects to 10.130.0.1 as the user "jscott" with the password "mypass" and downloads binary file named "somefile". You will, of course, need to customize it to match your requirements.

open 10.130.0.1
user
jscott
mypass
bin
get somefile
quit 

You execute the following command ftp -s:sitename.scr to run the batch file non-interactively. If the file is not binary, change bin to asc. You may need to specify the full path in the filename.

http://support.microsoft.com/kb/96269

For downloads that only use HTTP, get a utility named wget.

share|improve this answer

tftp is perfect for this stuff! it requires a tftp server, but means you can do one line file download commands.

It's been removed from the most recent MS server and client OS's because it makes downloading & installing virus payloads so easy!

tftp -i x.x.x.x get file.txt
share|improve this answer

I prefer to use ncftp for this kind of thing: http://www.ncftp.com/

share|improve this answer

wget and curl (open source utilities) should each be able to meet your needs.

wget: http://www.gnu.org/software/wget/

curl: http://curl.haxx.se/

(Despite the "haxx" domain name, it is a very safe and common open-source tool.)

-Waldo

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.