Update 11/20/2008: WinSxS, Disk Space and Windows 7. I encourage everyone to read this post first before you consider moving your WinSxS directory. You may just change your mind.
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.
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. This is an unsupported mod. Microsoft will not support you (and I cannot) should you choose to move the WinSxS directory.
- You will need two utilities: PendMoves and MoveFile. Place them in \Windows\System32 directory for easy access.
- 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 assign the Administrator user account ownership of the directory and then grant the Administrators group Full Access.
- Open an administrator command prompt, and create a dummy directory. Execute “mkdir c:\windows\winsxs.moved“
- Next, create a junction (like a Symbolic link for Vista). Execute “mklink /J c:\windows\winsxs.link winsxs.moved“
- Now delete the winsxs.moved directory. Execute “rmdir c:\windows\winsxs.moved“
- 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.
- 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.
- 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.
- 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!
- On reboot the critical renames/moves will execute, and the WinSxS directory will be unlocked and able to be moved in the next steps.
- 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.
- Using Windows Explorer, COPY the entire WinSxS.moved directory to a \Windows directory on another partition or drive.
- When the copy is finished, rename the new directory from WinSxS.moved to WinSxS.
- Go to an administrator command prompt and execute “rmdir c:\windows\winsxs“.
- Then, execute “mklink /J c:\windows\winsxs d:\windows\winsxs“.
- 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)
- 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!86,363 views