Exclude folder "c:\windows.old" on Image Backup

Is there any way I can exclude the folder “c:\windows.old” on image backup?
Thank you

1 Like

I understand why you’re asking…but I don’t think so. An Image is an image=everything.

1 Like

Add it to the FilesNotToSnapshot registry key ( https://docs.microsoft.com/en-us/windows/desktop/backup/registry-keys-for-backup-and-restore#filesnottosnapshot , https://docs.microsoft.com/de-de/windows/desktop/VSS/excluding-files-from-shadow-copies). Microsoft does this for normal Windows updates for example.

(It will delete all the files in this directory and there are a lot of files… so you’ll have to evaluate the performance or if it runs into timeouts with that)

4 Likes

Thank you for the info :wink:

Just delete the Windows.old

Better yet, run disk cleanup before imaging the M$ built in one (clenmgr.exe) as Admin, that gives you the option to get rid of:
Windows.old
Old redundant service pack files
All kinds of stuff from Windows updates
Past memory dumps
Saved error report stuff
Empty IE / Edge cache
Various other trash

Then reboot so windows update knows where it’s at (new updates sometimes fail if you don’t). THEN image

On a mature Windows install you’ll get rid of literally GBs of rubbish in addition to “Windows.old”, and because you did it with the proper tool, there won’t be registry entries pointing to Windows.old, which there would be if you simply deleted it.

Don’t be fooled you can’t use the same method on Windows Server either, by default cleanmgr isn’t there, but it appears if you install the “Desktop Experience” feature in Server Manager, well worth the small footprint for the savings Disk Cleanup provides.

To get cleanmgr.exe on a Windows server, without installing Desktop Experience, run the following commands in a Elevated Command Prompt:

xcopy /Y "C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.1.7600.16385_none_c9392808773cd7da\cleanmgr.exe" %systemroot%\System32
xcopy /Y "C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.0.6001.18000_none_c962d1e515e94269\cleanmgr.exe" %systemroot%\System32
xcopy /Y "C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr_31bf3856ad364e35_6.2.9200.16384_none_c60dddc5e750072a\cleanmgr.exe" %systemroot%\System32

xcopy /Y "C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.0.6001.18000_en-us_b9f50b71510436f2\cleanmgr.exe.mui" %systemroot%\System32\en-US
xcopy /Y "C:\Windows\winsxs\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.1.7600.16385_en-us_b9cb6194b257cc63\cleanmgr.exe.mui" %systemroot%\System32\en-US
xcopy /Y "C:\Windows\WinSxS\amd64_microsoft-windows-cleanmgr.resources_31bf3856ad364e35_6.2.9200.16384_en-us_b6a01752226afbb3\cleanmgr.exe.mui" %systemroot%\System32\en-US

cleanmgr.exe

It just copies the executable and its associated MUI files from the resource storage to the System32 folder. There are 3 different ones, to account for different builds of Windows Server.
The Disk Cleanup button will not appear if you open Properties for a drive afterwards, but you can always run cleanmgr.exe from the Start Menu, Run dialog, or Command Prompt.

1 Like

Useful info, worth noting for anyone reading this later, that running disk cleanup as Administrator, or starting it from an elevated command prompt saves some time waiting for the first scan to finish & then making it scan again when you click “cleanup system files”, since if it runs elevated it scans them for cleanup anyway & you can always uncheck any box you don’t want cleaned up.

1 Like

This doesn’t work on Windows XP/Server 2003.

I need to do an image backup of Windows server 2003 R2 without one huge folder and all files with one file extension (they are big and not important). I cannot do it with UrBackup which is very sad. Acronis does this easily but it’s very expensive.

If I to decide to make a backup of this PC with UrBackup I first must remove all unneeded files, make the image backup, than restore files and setup the file backup. But what if there are more such PCs?

Why to exclude something of user’s choice is such a big deal? Serious backup software have to be able to do such essentials things.

Just a heads up, this might not be such a good idea to do.
Depending when the image ran, Windows takes it’s sweet time migrating things back out after an upgrade.

Image at the wrong time & you may have issues after a restore.
CCleaner took away the option to remove Windows.old in v 5.45 because people had been using it too soon & creating problems for themselves.

The recommended approach to not having this backed up would be to run Disk Cleanup built into windows (cleanmgr.exe) & cleanup system files to simply remove it as that tool handles it correctly, communicating with the servicing stack.

This may also have implications for Windows.old being in the default file backup excludes.

1 Like