Backing Up Locked Files

One of the challenges of migrating someone from one computer to another is the data they may have on the C: drive, especially those evil PST files.  The major challenge is backing up locked files.  We can get around this by using VSC in Windows.  Starting with Windows XP, VSC or Volume Shadow Copy allows Windows to “freeze” the state of the file system in time and then copy files/folder in this frozen state.  We will use the freeware program VSCSC to tap into this power.

First we use Mapper24 to encrypt/hide the credentials for the service account that will connect to our server:

mapper24.exe <some encrypted chars> domainusername \serverbackup

Next, we make a folder with the name of the computer we are running from:

 mkdir \serverbackup\%computername%

Then we kick off VSCSC:

vscsc -exec=wkxp2.cmd C:

In wkxp2.cmd, we have this:

robocopy “B:\documents and settings\serverbackup\%computername%” /B /MIR /R:0 /XF *.ost *.tmp *.bak *.dat *.mp3 /XD “Local Settings” “Temp” “Cookies” “Recent” “Nethood” “Printhood” “SentTo” “Start Menu”

So here is what we are doing…we are creating a snapshot in time, then we can use any copy program we want to copy files when “time is frozen” within this snapshot.  Once we exit the script, VSCSC exits and the snapshot is gone.  In the above robocopy script: I am telling it to exclude folders like Local Settings since that is where the internet temporary files are stored.  And yes: this will copy ALL user profiles on the computer to the server, not just the one we want, so you will have to pick through the profiles and grab what you want.

We can log in as the new user on the new computer and just drop in the Desktop, Favorites and My Documents folders manually from the server.

Note that vscsc doesn’t seem to work on Windows 7.  For Windows 7 you will need to copy Diskshadow from Server 2008 or 2008R2 or as a download from here:  Copy the contents of the ZIP file to System32, including the en-US folder or it will not work properly. The concept is pretty much the same:

set context persistent nowriters
set metadata C:\windows\temp\
set verbose on
begin backup
add volume C: alias C_Drive
expose %C_Drive% X:
exec yourbatchfile.cmd
delete shadows volume C:
unexpose X:
end backup

Update (12/21/16): As an update to this article, I find that ShadowSpawn to be superior to the above method and a lot easier.  Essentially, it’s copy 2 files over and run one command line to copy files.  As an example you could do something like:

shadowspawn C:\archives X: xcopy X:\*.pst C:\path\to\backup 

– Soli Deo Gloria

Case of the Troublesome OptiPlex 390

We got in a batch of new Optiplex 390s recently and our Windows XP image just wouldn’t work on them.  The image would come down, Windows XP would boot once through the SYSPREP process and then I would get a lovely BSOD of 0x000000ED with UNMOUNTABLE_BOOT_VOLUME on the 2nd boot.  This wasn’t the famous STOP 7B error I was use to, but something else.  I had added support for the Optiplex 390 over a year ago, so this was quite odd.  I took another Optiplex 390 and imaged that as well (thinking I had a possible hardware issue on my hands) and got the same thing.  These were the exact same symptoms from the WinPE uberbug and I eventually found this article over at Dell.  I am using WinPE 3.0, so I patched it with KB982018.  No go.  I even took my “uberbug script” out and no joy.

I then stumbled upon this thread, again at Dell, and it sparked something.  I did have ExtendOEMpartition=1 in my sysprep.inf file.  It has been there for years, never causing a problem.  I mounted the WIM using ImageX, changed ExtendOEMpartition to 0 in C:sysprepsysprep.inf and then re-imaged and bang: success!  It appears that SYSPREP doesn’t understand the new aligning procedure for these hard drives and makes certain assumptions, which of course are now incorrect.

HP has a very decent whitepaper on the issue here and if that’s not available, it’s also here on my web site in case they decide to remove it.  Supposedly, Vista with SP1 and later do not have the issue and neither does WinPE 3.1 or beyond.

Windows XP: I wish I could quit you, but I can’t!

– Soli Deo Gloria