BITS

From EggeWiki

BITS is Microsoft's Background Intelligent Transfer Service. Today I wanted to install C# so I could play around with the Communicator API. So, I found the download on Microsoft's website. I was able to get the web installer to run, but it failed because I don't have BITS installed on my PC (this is common in the enterprise). So I have to go install BITS, which required installing Windows Genuine Advantage. I finally got BITS installed, and did the required reboot. Still, I wasn't having any luck with my install.

So, I installed the bitsadmin tool, which came with a load of other XP utilities. The bitsadmin tool is a perfect example as to why Microsoft can't create a decent command line tool. In the case of BITS however, they don't provide a GUI either.

To start, I needed to list my jobs:

C:\Program Files\Support Tools>bitsadmin /list

BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

{B60C94C3-6C66-44DB-8371-61F9272E41AA} Visual Studio Express SUSPENDED 0 / 1 0 /
 UNKNOWN
Listed 1 job(s).

Notice how the name of the job is a GUID. Also, QuickEdit is off by default, so I had to turn that on to copy and paste. I assumed the problem was that it couldn't get through the proxy server without authentication.

C:\Program Files\Support Tools>bitsadmin /getproxyusage {B60C94C3-6C66-44DB-8371
-61F9272E41AA}

BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

PRECONFIG

Now, I just need to set my password.

C:\Program Files\Support Tools>bitsadmin /SETCREDENTIALS {B60C94C3-6C66-44DB-837
1-61F9272E41AA} PROXY basic brian password

BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

OK.
C:\Program Files\Support Tools>bitsadmin /RESUME {B60C94C3-6C66-44DB-8371-61F927
2E41AA}

BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

Job resumed.

Now, I just have to check to see if it's running:

C:\Program Files\Support Tools>bitsadmin /list

BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

{B60C94C3-6C66-44DB-8371-61F9272E41AA} Visual Studio Express TRANSFERRING 0 / 1
1192603 / 4217864
Listed 1 job(s).

It turns out there are 9 different files which Visual Studio must download, and the process is the same for each one. So, I thought I could write a script in Cygwin/bash to do the job.

$ bitsadmin /list

BITSADMIN version 2.0 [ 6.6.2600.2180 ]
BITS administration utility.
(C) Copyright 2000-2004 Microsoft Corp.

Unable to get console input mode - 0x80070006