<

Relocating the winsxs folder

Published on
33,388 Points
27,088 Views
3 Endorsements
Last Modified:
Approved
Update 11/3/2014 - Although the below article will get you to relocate the WINSXS folder, Microsoft has finally released a utility to reduce the size of the WINSXS folder. For some reason, it's not that straightforward. It only works on Windows 2008 and above (those are the only OS's affected by the large WINSXS folders)

In a recent update, MS has updated the disk cleanup wizard (cleanmgr.exe) on Win 2008 x86, Win 2008 x64, & Win 2008 R2. I'm not sure about desktop OS's, but I would assume they got the update too.

The new cleanmgr.exe has an option to clean up windows update files. This will clean out Gigabytes from the WINSXS folder (although not everything). You will not see a gain in space until you reboot the machine. When you reboot after running the cleanmgr.exe utility, it will come up like it had just applied updates, with the Screen 'Configuring WIndows Updates ... Do not power off your computer'. After the reboot you will see the size of WINSXS has been greatly reduced. I've got back anywhere from 2 to 10 GB.

The funny thing is that although the new cleanmgr.exe will exist on your computer if you've been keeping up with windows updates, it's not readily available unless you move some files around. Follow the instructions below to put the cleanmgr.exe and related files in the proper place and then you can run them:

The location of the files you need to copy depend on your version of Windows: Execute the copy command based on the appropriate version

Windows Server 2008 R2
 64-bit
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe %systemroot%\System32
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui %systemroot%\System32\en-us
cleanmgr.exe
 
Windows Server 2008
 64-bit
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.0.6001.18000_en-us_b9f50b71510436f2\cleanmgr.exe.mui  %systemroot%\System3
copy C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.0.6001.18000_none_c962d1e515e94269\cleanmgr.exe.mui %systemroot%\System3\en-us
cleanmgr.exe
 
Windows Server 2008
 32-bit
copy C:\Windows\winsxs\x86_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.0.6001.18000_en-us_5dd66fed98a6c5bc\cleanmgr.exe.mui %systemroot%\System3
copy C:\Windows\winsxs\x86_microsoft-windows-cleanmgr_31bf3856ad364e35_6.0.6001.18000_none_6d4436615d8bd133\cleanmgr.exe %systemroot%\System3\en-us
cleanmgr.exe

You can now launch the Disk cleanup wizard by running Cleanmgr.exe from the command prompt or Start > Run.

************************************************************************************

I've seen a few articles about moving the \Windows\winsxs folder. Most of these involve using third-party utilities to do pending moves and pending renames on reboot. I've found a simpler way that requires no addittional utilities. Thanks to those folks who developed those methods using the utilities, as it got me started on developing this simpler method.

Winsxs is short for 'Windows Side by Side' It allows for the hosting the same files in different versions in the operating system. The folder and it's contents are necessary for the normal operation of your computer. You should NOT simply delete or move this folder. In testing, I did blue-screen a machine by making it's winsxs folder unavailable.

It exists in Windows Vista, Windows 7 and Windows Server 2008.

The problem with it is it can get huge. Typically more than 5 GB but sometimes in excess of 15 GB. This can be a problem if your system drive is undersized with no way to expand it, or if you've paid for the expensive real estate of  a solid-state-disk, and don't want to waste all that space.

In summary, we will create an empty target winsxs folder in a different location from the system volume, then reboot into repair mode, copy the source contents to the new location, rename the source, and drop in a symbolic link to the new location. Upon restart, we can delete the original.

While in repair mode, drive letters can be different from when Windows is running normally. The saving grace is you can create a symbolic link to anywhere, even if the target doesn't exist. You just make your symbolic link target to the path of the relocated winsxs folder is while windows is running normally, regardless of what the drive letters are in repair mode.

In the below example, while booted into Windows, the Windows directory is C:\Windows, and the target winsxs folder is K:\Windows\Winsxs
While booted into Repair, the Windows directory is E:\Windows, and the target winsxs folder is D:\Windows\Winsxs
 

1. Create Target

With the machine running normally in Windows, create or identify target volume that will contain the winsxs folder
Create the empty path for \Windows\winsxs on that volume (K:\Windows\winsxs).
This path will be what you use in the repair console regardless of what drive letter is assigned while in the repair console.
Assign NTSERVICE\TrustedInstaller owner and full control of the folder.

2. Boot into Windows Repair

Restart the system and hit F8 before windows starts. Select 'Repair your computer'. If you don't see this option, you can boot off the Windows CD and there is a 'repair you computer'.
When the repair your computer GUI comes up, select command prompt.

3. Locate Volumes and Paths

Locate original system volume, it may not be C: when in repair boot (DISKPART helpful)
Locate target volume and path, it may be different when in repair boot

4. Copy winsxs content

Change directory to the Windows directory
xCopy contents of original winsxs folder to target winsxs folder
xcopy E:\Windows\winsxs D:\Windows\winsxs /e

5. Rename Source

Rename original winsxs folder
rename winsxs winsxs.old

6. Create Symbolic Link

Create a symbolic link in the original location that points to the new winsxs folder.
mklink /D winsxs K:\Windows\winsxs

7. Reboot

Reboot and start Windows normally

8. Confirm Success and Clean Up

Confirm C:\Windows\winsxs symbolic link exists and is targeted properly. It should function just like the folder is there in C:\Windows, however the content is on the other volume.
Delete original winsxs folder
rmdir E:\Windows\winsxs.old /s
3
Author:Adam Lewis
Enjoy this complimentary article view.

Get unlimited access to our entire library of technical procedures, guides, and tutorials written by certified industry professionals.

Get 7 days free
Click here to view the full article

Using this article for work? Experts Exchange can benefit your whole team.

Learn More
COLLABORATE WITH CERTIFIED PROFESSIONALS
Experts Exchange is a tech solutions provider where users receive personalized tech help from vetted certified professionals. These industry professionals also write and publish relevant articles on our site.
Ask questions about what you read
If you have a question about something within an article, you can receive help directly from the article author. Experts Exchange article authors are available to answer questions and further the discussion.
Learn from the best.