Windows Tip Sheet

Downloading Frenzy

BITS lets you take back your CPU when downloading large software and program files.

Turns out you can have too much of a good thing. I'm on beta programs for about a half-dozen software programs and it seems like this week has seen a new build for every one of them. Of course, that means downloading a half-dozen huge, new ISO images on top of all the Microsoft updates I need to download and the regular work I need to do. Simply downloading everything using my browser's download manager takes up too much bandwidth, so it's Background Intelligent Transfer Service (BITS) to the rescue!

Slow BITS, Easy BITS
BITS comes with WinXP and Win2003, although Microsoft has positioned it as a tool more for developers to use within their applications than for us admins. Fortunately, Windows 2003 ships with a command-line tool named BITSAdmin (find it in Support Tools on the install CD if it isn't installed), and you can copy it to WinXP with no problems.

Start by creating a job: bitsadmin /create /download jobname. Keep the job name simple; you're the only one who will be using it. Next, add files to the job: bitsadmin /addfile jobname remote-url local-pathname. Give it the complete remote URL to download and the final local path and filename you'd like the file to have. Add as many files as you like—BITS will get them one at a time.

Kick it off with bitsadmin /resume jobname, and keep an eye on things with bitsadmin /list /allusers. When BITS lists a job as finished, run bitsadmin /complete jobname to wrap things up and move the files to their final locations.

BITS is cool in that it only uses "spare" bandwidth. If you start doing something else on your PC, BITS will back off and give up bandwidth until you're done. That means you can keep working while it downloads in the background. BITS also supports auto-resume of interrupted downloads and can even resume after you log off and log back on. It can even access protected URLs: Run bitsadmin /setcredentials jobname server auth-scheme username password. Auth-scheme will usually be "basic" for Internet downloads.

You can even—and this is really useful—have BITS run a command line for you when a job is done: bitsadmin /setnotifycmdline jobname command-line. This allows you to have a batch file run when a job is finished that automatically runs the /complete command to wrap up the job.

By plugging all my downloads into BITS, I was able to keep working. When the downloads had finally trickled in, I was ready to start installing. If only BITS could speed that up, too. Microsoft thinks BITS is cool, too. Windows Update, Software Update Services, and Windows Update Services all use BITS in various capacities.

Micro Tip Sheet

WinXP's version of BITS only supports downloads. Win2003's version (1.5) supports uploads, too, to any server (e.g., IIS 6.0) running the BITS extensions. XP SP2 will include version 2.0 of BITS, which supports uploads. Note that the BITSAdmin tool works with WinXP, but you'll get an error if you try to create an upload job and haven't installed SP2 yet, because the underlying version of BITS 1.0 on WinXP doesn't do uploads. Microsoft Windows Update 5 also installs the BITS 2.0 client; see http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/
sp2wuins.mspx
for details.

As an alternative, you can always install a download manager: Download.com lists more than a hundred of them, both commercial and free. Most support auto-resume (which is actually a feature of certain HTTP 1.1 commands, which almost any modern Web server can handle), but few support background transfers using "spare" bandwidth the way BITS does. Many, in fact, use multiple connections and segmented downloads to help speed up downloads, although they consume more foreground bandwidth to do so.

More Resources
MSDN reference to BITSAdmin: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/bits/bits/bitsadmin_tool.asp

Windows Support Tools documentation for BITSAdmin: http://www.microsoft.com/resources/documentation/WindowsServ/2003/all/
techref/en-us/Default.asp?url=/resources/documentation/windowsServ/
2003/all/techref/en-us/bitsadmin.asp

Under-the-hood details of how BITS works: http://www.microsoft.com/windowsserver2003/techinfo/overview/bits.mspx

About the Author

With more than fifteen years of IT experience, Don Jones is one of the world’s leading experts on the Microsoft business technology platform. He’s the author of more than 35 books, including Windows PowerShell: TFM, Windows Administrator’s Scripting Toolkit, VBScript WMI and ADSI Unleashed, PHP-Nuke Garage, Special Edition Using Commerce Server 2002, Definitive Guide to SQL Server Performance Optimization, and many more. Don is a top-rated and in-demand speaker and serves on the advisory board for TechMentor. He is an accomplished IT journalist with features and monthly columns in Microsoft TechNet Magazine, Redmond Magazine, and on Web sites such as TechTarget and MCPMag.com. Don is also a multiple-year recipient of Microsoft’s prestigious Most Valuable Professional (MVP) Award, and is the Editor-in-Chief for Realtime Publishers.

comments powered by Disqus

Reader Comments:

Thu, Sep 16, 2004 Corey Nowhere, PA

It sounds great, but I wonder if they checked the sources for buffer overrun attacks...

Thu, Sep 16, 2004 Andy Cheshire, UK

excellent - I've heard about bits being used to download sp2 (for example) but didn't realise you could use it for command line downloads.

Wed, Sep 15, 2004 Robert Bangkok

Interesting article. You mention that BITS uses only "spare" bandwidth. Is that relative to the host, or to the network? Presumably only to the host, so on a company network the gateway would not differentiate between a normal user request and a BITS request?

Wed, Sep 15, 2004 manster California

This is a great tool. However, why does Microsoft not give people the option of using BitTorrent. This will save the internet the world over!!!

Wed, Sep 15, 2004 Rob Campbell DC

Great article. Note that BITSADMIN.exe is located inside SUPPORT.CAB in in the Support-Tools directory on the CD. It can be extracted directly without installing the Support Tools.

Wed, Sep 15, 2004 Steve Seattle

Thanks Don, Good article. I wasn't aware of BITS. It just skipped by my radar screen

Add Your Comment Now:

Your Name:(optional)
Your Email:(optional)
Your Location:(optional)
Comment:
Please type the letters/numbers you see above

Redmond Tech Watch

Sign up for our newsletter.

I agree to this site's Privacy Policy.