How to increase SSD free space (move WinSxS folder)

Windows OS Specific Topics
Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to increase SSD free space (move WinSxS folder)

Post by Saman » Sat Jan 04, 2014 6:31 pm

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.

PREREQUISITES:
You will need two utilities: PendMoves and MoveFile. Place 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 assign the Administrator user account ownership of the directory and then grant the Administrators group 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!
Post Reply

Return to “Windows”