In January, I showed you how to
move your program files and your profile folder to a different partition using robocopy and mklink. With NTFS junctions, you (and your programs) can transparently use the folders on your C drive, while the actual data lies someplace else.
Unfortunately, today, some Windows Updates where shipped that try to install on every reboot, but fail with error code 80070011. Using
GoogleScroogle, I quickly
found out why (and how to fix it manually).
Cause: If files cannot be replaced because they're open, updates write XML commands to \SystemRoot\WinSxS\pending.xml (usually C:\Windows\WinSxS\pending.xml, unless you've installed Windows to a different partition). This file will be processed on reboot. To replace files, updates create hard links at the destination, like this:
CODE:
<HardlinkFile source="\SystemRoot\WinSxS\amd64_microsoft-windows-ie-internetexplorer_31bf3856ad364e35_6.0.6000.16609_none_89a35f80d52d451d\iexplore.exe" destination="\??\C:\Program Files\Internet Explorer\iexplore.exe"/>
This will fail if "Program Files" is on a different partition, as files can only be hard linked within the same partition. I highly doubt that Microsoft will ever fix this, because moving program data to a different partition is not officially supported.
Workaround: If you don't want to move your program files back to C: (like me), there seems to be only one way to fix this: By copying the updated files the the same partition as the real program folders, and by changing all HardlinkFile references to this new location, it will work.
alantangcs posted a nice step-by-step guide on how to edit pending.xml (you have to change ownership of the file first).
Because I don't expect this to be the last time an update tries to change Program Files, I wrote a little script that does most of the work: It will provide a copy of pending.xml with all necessary replacements and copy the files to a directory called "WUTemp" on the same partition as your real program files. If you don't supply the real location of your program files by command line, the script will ask for it.
A slightly easier workaround might be to replace the affected HardlinkFile commands by CopyFile (not sure if it exists) or MoveFile (exists, but I don't know how it reacts if the target already exists). That way, the files can stay in WinSxS. I haven't tried this, and be warned: If you mess with pending.xml and Vista doesn't boot, it won't even boot in Safe Mode. Try in a VM or keep some recovery disk handy.
Continue reading "Vista: Windows Update Error 80070011 Semi-Automated Fix"