Category Archives: VB Scripts

VBscripts tricks, tips and complete scripts. These can be an entire script or a small tidbit I had trouble getting to work.

Volume Shadow Copy, use it everywhere you can.

By far one of my favorite (and most life saving feature) is the Volume Shadow Copy feature in Windows.

(For anyone familiar with shadow copy, check tomorrow’s post for a trick with shadow copy that saved me)

For anyone not familiar, Shadow Copy is a feature included in Windows since XP SP2 (workstation and server).  It is a feature that will allow you to go back to different points in time on a drive and retrieve files that have gone missing or have been damaged. It can also be useful if you made changes you can’t undo.

The amount of time you can go back isn’t infinite. I can usually count on at least a week or more depending on the level of changes done. In terms of use on a server, you can set the percent of the drive reserved for shadow copy. I used to use 10% though I now use 20%.

How To Use

For those not in the now, to get to shadow copy, you right click on a drive or folder and select Previous Version. This will open a dialog with different points in time that are available. Opening one of them will give you access to a folder that contains what your files were at the point in time you selected.

Be warned though that if you copy large missing items back to the same drive, you risk eating away at the shadow copy space and may cut off what you are trying to save. The space is limited and new changes push out the old. If your file is a small document, you shouldn’t be worried. If it’s a missing movie file, you may need to give more thought to your approach and use external media. You will be able to tell when you have eaten away the old shadow copies as the older dates previously listed will now be gone.

How to Enable (Workstation)

I have actually pushed out Shadow Copy as a policy for workstations and it has saved us more than a few times. With Windows 7 (and up), you just need to use Group Policy preferences and set the Volume Shadow Service to Start and set the service to start right away.

I really enjoy Windows 7 but there are a few items I would have done differently. Older versions of windows had a My Docs icon with the username that was a self contained folder. It was available from the start menu and Save dialog boxes.

This was great for anyone who uses folder redirection because you knew all user items were most likely going to the right place. You didn’t have to tell your users anything. Now with Windows 7, the common icon with the username takes you to the root of your profile and no amount of redirection will help you make sure those files are in a safe place.

Having Shadow copy gives us some comfort (assuming the drive doesn’t die).

(Post-edit, after getting a request for this, I realized I should have posted the script I scheduled for workstations that triggers the shadow copy)

Here is the script: shadowcopy.txt (rename to .vbs)

How To Enable (Server)

On a server, you need to go into the properties of a drive and go on the Shadow Copies tab. You can enable it for all drives from her and set the schedule. The default is twice a day. I prefer three times daily (7am, 12pm and 5pm). The 5pm may not catch as much but it is good for anyone working remotely after hours.

I strongly recommend enabling Shadow Copy on the C: drive on your DC’s. My post tomorrow will reveal at least one reason for that.

I haven’t tried the Shadow Copy to different drive option so I can’t comment. It seem a bit cumbersome and you would have one more drive to maintain.