Tuesday 16 December 2014

Deleting the 'System Volume Information' folder from a USB drive (and other system files\folders)

Note for new visitors: The method described below will work for any Windows volume (not just E2B or .imgPTN files).

If you want to copy a whole partition or make a .imgPTN file from a partition volume by dragging-and-dropping the volume letter icon onto a MPI_FAT32 or MPI_NTFS Desktop shortcut, you may find that the process reports an error if Windows fails to copy some of the protected files and folders that it may already be present on the partition.

You can use strarc to copy all WindowToGo OS files to a different folder and preserve symbolic links, etc.

A simple way to avoid this is to copy the files from the entire USB drive to an empty folder on your PC's hard disk. This way you only copy the files and folders you need. You can then drag-and-drop the folder onto one of the MPI shortcuts.

If using XCOPY to copy files use /cherky instead of /herky so that errors will not stop XCOPY from continuing,

However, it may not be practical to do this, so how do we delete these pesky files and folders?

It is possible to modify your version of Windows (via GPO or Registry edit) so that it does not create the System Volume Information on all USB drives and other Removable media that are connected to the system (see here - then use rd "U:\System Volume Information" /s from an admin console to remove the folder).  If you want to do this easily, download the registry fragment (here) and double-click on the .reg file to add the registry key.

Note: In recent versions of Windows 10, as well as the Registry Fragment, you need to stop (disable) the Storage Service too (type Services into the start menu to find the management applet).

However, if you insert your USB drive into a different Windows system that does not have this patch, then the System Volume Information folder will be created again.

To stop any Windows system from creating this pesky folder...

First, make sure you have changed the Windows Explorer View properties to show all Hidden and System files. You should now see more files and folders, one or more of which may be causing the problem!

You may find that the USB volume contains a System Volume Information folder which is hard to delete, especially under Windows 8/10.

Other files which may be present on the USB drive, such as hiberfil.sys, pagefile.sys and swapfile.sys, and folders such as $RECYCLE.BIN may be easier to delete.

I eventually found something that worked for the System Volume Information folder, which is described here.

However, even if I removed the System Volume Information folder, Windows just re-created it on the USB drive again after a short while! I found that I could also force the folder to appear, by searching for a file on the USB drive using Explorer with Indexing enabled.

How to permanently remove the System Volume Information folder

So here is how to take care of these pesky files and folders...

1. First download the Take Ownership Vista+ registry fragments from here (Vista/7/8 systems) and extract the .reg files to your Desktop. If you have Windows XP use the reg fragments here.

2. Double-click on the InstallTakeOwnership.reg file on the Desktop and install it into the Registry - this just adds a new Take Ownership right-click option into Explorer. It can be removed later using the UnInstall registry fragment (but there is no need and it is quite handy to have).

3. Right-click on a problem file or folder and select the TakeOwnership option - do this on the System Volume Information folder and any other 'difficult' ones.

4. Now try deleting the file or folder using Windows - but to stop the System Volume Information folder from re-appearing, we need to open a System Admin command console and run the following commands (assuming the USB drive is H:)...

attrib -h -r -s H:\*.*
rmdir "H:\System Volume information" /S /Q && echo dummy > "H:\System Volume information"

This immediately creates a file called "System Volume information" after deleting the folder and thus prevents Windows from creating a new folder of the same name.

If you prefer, you can use DelSysFiles.cmd (in Easy2Boot download at \_ISO\docs\E2B Utilities\DelSysFiles) - just drag-and-drop a volume letter onto the DelSysFiles.cmd batch file or run it from the command line - e.g. DelSysFiles  H:

See also: here for more methods and information.

If you found this article useful, please subscribe.

No comments:

Post a Comment