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

Don Jones is a multiple-year recipient of Microsoft’s MVP Award, and is Curriculum Director for IT Pro Content for video training company Pluralsight. Don is also a co-founder and President of PowerShell.org, a community dedicated to Microsoft’s Windows PowerShell technology. Don has more than two decades of experience in the IT industry, and specializes in the Microsoft business technology platform. He’s the author of more than 50 technology books, an accomplished IT journalist, and a sought-after speaker and instructor at conferences worldwide. Reach Don on Twitter at @concentratedDon, or on Facebook at Facebook.com/ConcentratedDon.

comments powered by Disqus
Most   Popular