Here is about the most useful bit of script magic I have seen for Windows in quite awhile:
The script shown here allows you to create a persistent snapshot of a Windows Server 2003 volume, and then expose it as a drive letter. This opens up all sorts of other scripting possibilities. Most immediately, it allows me synchronize filesystems from a point-in-time copy on demand on in a scheduled task. I need this for replication of Windows deployment points, and for refreshing our pre-prod ApplicationXtender server from the production environment.
This script uses “VSHADOW.exe”, part of the VSS SDK available here:
VSHADOW cannot expose existing “client accessible” shapshots that were generated by standard Volume Shadow Sopy Service scheduled tasks, but you can use this script to schedule your own snaps. VSHADOW can even create a snap, execute arbitrary code (such as “robocopy”), and then delete the snap immediately (using “non-persistent snapshots).