Single Point of Contact

a Matthew Wade blog

Single Point of Contact header image 2

How to move the WinSxS directory in Vista

December 5th, 2007 · 3 Comments · Microsoft, Vista

I stumbled upon a post in a forum the other day and as I began to read I suddenly realized that the author has solved a long standing issue I had with Vista, the HUGE WinSxS directory.  According to Microsoft literature this directory can not be moved or deleted.  Sounds like a challenge to me. 

The following process outlines how to move this directory to another location.  This process is not for the faint of heart but if followed carefully will get the job done.  A certain degree of computer knowledge is assumed.  I’ve include a link to the original post to give credit where credit is due…and cleaned up the language a bit to make it easier to read.

Thanks Paul for your hard work…

WARNING: Proceed at your own risk.  Incorrectly performing the following procedure may cause irreversible damage to your OS.  It is highly recommended to backup your system before proceeding.

Prerequisites:
  1. You will need two two utilities: PendMoves and MoveFile.  Drop them in \Windows\System32 directory for easy access.

 

Procedure:
  1. In Windows Explorer navigate to the \Windows\WinSXS directory.  Right click the directory to bring up the quick menu and select Properties.  Click the Security tab to view the security properties. You will need to take ownership of the directory and then grant your account full access.
  2. Open an administrator command prompt, and create a dummy directory.   Execute “mkdir c:\windows\winsxs.moved
  3. Next, create a junction (like a Symbolic link for Vista).  Execute “mklink /J c:\windows\winsxs.link winsxs.moved
  4. Now delete the winsxs.moved directory. Execute “rmdir c:\windows\winsxs.moved
  5. Now we will use MoveFile to schedule renaming of the WinSXS directory at reboot. This is the magic that will give us control over the directory.
  6. From the administrator command prompt, execute “movefile c:\windows\winsxs c:\windows\winsxs.moved“. As you can see, this is renaming the WinSxS directory before Vista can get a lock.
  7. From the command prompt, run “movefile c:\windows\winsxs.link c:\windows\winsxs“. This puts a winsxs directory back (as far as Vista is concerned), so everything doesn’t collapse in a heap.
  8. From the command prompt, run “pendmoves“. It will show the two pending moves you’ve entered above, with NO ERRORS. If it all looks good, REBOOT!
  9. On reboot the critical renames/moves will execute, and the WinSxS directory will be unlocked and able to be moved in the next steps.
  10. Open an administrator command prompt, and execute “dir c:\windows\winsxs*“. If you performed the previous steps correctly, you’ll see a WinSxS.moved directory and the WinSxS junction.  If it did not work, repeat the above steps.  Our next step is to relocate the WinSXS directory and amend the junction.
  11. Using Windows Explorer, COPY the entire WinSxS.moved directory to a \Windows directory on another partition or drive.
  12. When the copy is finished, rename the new directory from WinSxS.moved to WinSxS.
  13. Go to an administrator command prompt and execute “rmdir c:\windows\winsxs“.
  14. Then, execute “mklink /J c:\windows\winsxs d:\windows\winsxs“.
  15. To be sure everything is happy, in Windows Explorer browse to c:\windows\winsxs. You will see all of the files.  (Even though they are actually on your other partition or drive)
  16. Reboot
  17. After reboot, you should be able to delete c:\windows\winsxs.moved and FINALLY liberate all that disk space.  Whew!  Now take a bow.

This process can also be applied to the Windows Updates directory.  When you download Windows Updates etc., the files get placed into C:\Windows\SoftwareDistribution, and this will quickly become huge. It is easier though… stop the Automatic Update service, move directory, create junction, restart service, DONE!

Tags:

3 responses so far ↓

  • 1 Aaron Tiensivu's Blog // Dec 5, 2007 at 10:08 pm

    Moving the WinSXS directory and the SoftwareDistribution (used by Windows Update) folder out of the Windows directory

    A nice step by step write up, based off Paul’s excellent post here, by the infamous Matt Wade can be found on his site here.

    Not only does he describe how to move the WinSXS directory, but also the SoftwareDistribution directory, which is used by …

  • 2 Moving the WinSxS and SoftwareDistribution (Windows Updates) Directories | Elan Shudnow's Blog // Dec 5, 2007 at 10:26 pm

    [...] detailed the steps on how to move the WinSxS and SoftwareDistribution (Windows Updates) directory here; thanks to a forum post created by Paul [...]

  • 3 AnnihilatorX // Mar 19, 2008 at 2:16 pm

    You ought to be careful with that though. Some updates, notably Vista SP1, would fail with an error numbered 80070011 if you junction the winsxs or program files folder.

You must log in to post a comment.