Windows Update through a proxy server

It's far from trivial how to use Microsoft's Windows Update service if the net is available only through a proxy server. I've done it some times in the past, but forgot the details so I had to go over it again. Now I'll describe the major steps (assuming the OS is Windows XP) so I won't have to rediscover the tricks anew ... and maybe it'll help others too. Smile

Here's the list of things you have to do:
  1. First of all you'll need a proxy capable of both HTTP and HTTPS data transfers. Login to the PC with an admin account, configure the proxy for these two protocols in IE and test whether you can access the net via the proxy or not.
  2. Start a command prompt and execute the following:
    C:\>proxycfg -u
    Microsoft (R) WinHTTP Default Proxy Configuration Tool
    Copyright (c) Microsoft Corporation. All rights reserved.

    Updated proxy settings
    Current WinHTTP proxy settings under:
      HKEY_LOCAL_MACHINE\
        SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Connections\
          WinHttpSettings :

        Proxy Server(s) :  127.0.0.1:3333
        Bypass List     :  <local>
    This will configure the WinHTTP service to use the IE proxy settings of the currently logged in user, which is in my example a HTTP proxy listening on localhost (127.0.0.1) and on TCP port 3333.
  3. Set the "Background Intelligent Transfer" service and the "Automatic Updates" service to Automatic startup and start them if they are not running (or restart them if they are). It's not enough to set them to Manual startup, because the damned WindowsUpdate code checks the startup type of these services, too. Sad
  4. Now you can load the Windows Update website in IE and start downloading and installing updates through your proxy.
One thing I've not tested is what happens if the proxy asks for a username and password. Maybe if you configure IE to store passwords, then the proxycfg command can copy that to the WinHTTP proxy settings as well.

P.S: I could not make Windows Update work through a SOCKS proxy. If someone has succeeded with this, then I'd appreciate if she/he shared the trick with me. Smile
P.S2: airwin asked me how could this be achieved (Windows Update through SOCKS) so I've spent some time playing with it. Finally I succeeded and documented the possible solutions here.