Friday, November 14, 2008

Use Sync Toy 2.0 to Backup Your Files

There seems to be a never-ending list of utilities to perform maintenance on your computer. From anti-virus software to defrag programs-everyone is out to sell you something. There is a glimmer of light at the end of the software tunnel: SyncToy 2.0 from Microsoft.

I know, some of you Microsoft bashers (probably Linux lovers) will hate this article as a matter of principle. Well, feel free to click away. Here's a good site. For the rest of you, get ready to learn how to put your mind at ease when it comes to your backups.

Before even starting on a backup configuration, I'm assuming you've got one thing in place already-something to back up to. There are many possible solutions, each with their good points and their bad points. That is a subject for another article. For the sake of this article, we'll assume you are using an external USB drive.

Here is a step-by-step tutorial on setting up synchronization using SyncToy 2.0:

Download and install SyncToy 2.0 from Microsoft's download page.

Run SyncToy. Go to start, Programs, SyncToy 2.0. The first time you run the program, you are given the opportunity to participate in the Customer Experience Improvement Program. I chose not to. Here's what you'll see the first time:



Click 'Create New Folder Pair'. Here's what you'll see now:



Imagine taking something from the left side of your desk and placing it on the right side. That's how SyncToy 2.0 organizes synchronization. You choose which files you want to synchronize (left side) and where you want the files synchronized to (right side). So I'm synchronizing my c:\logs folder to my z:\logs folder (on the USB drive). Click 'Next'



There are three options on the next screen. If you select each option, it describes it in the pane to the right. I chose 'Echo', which only takes what I have in the c:\logs folder (left side) and puts it on my USB drive (right side). Click 'Next'.



Name your folder pair. Choose something descriptive so you know what it does when you look at it later. Click 'Finish'.



Here's where SyncToy 2.0 gets interesting. You can have multiple folder pairs each with different actions associated with them. You can run one or all of them at the same time. Personally I run a nightly synchronization. This way it's not running while I need my computer's processing power during the day.

If you press the 'Preview' button, you will get a list of files that would be synchronized if you were to run it now. Here's a sample from my c:\logs directory:




Advanced Options

One of the most powerful options available in SyncToy 2.0 is the scheduling feature. This can be used to run a synchronization when nobody is logged on to your computer or at an hour when you're peacefully dreaming about what you would do if you were on Survivor. Here's how to schedule SyncToy 2.0.

In Windows XP, open your control panel. Choose 'Scheduled Tasks', then 'Add Scheduled Task'. You'll see the following. Click 'Next'.



If you choose the program from this menu, scheduling won't work. Click 'Browse'.



Go to c:\Program Files\SyncToy 2.0 and select 'SyncToyCMD.exe'. Click 'Open'.



Enter a name for your scheduled job. Name it something descriptive so you'll know what it is next time you look at it. Select the frequency of your schedule. I chose to run it daily. Click 'Next'.



Now you get to choose a time. Obviously, you'll need to select a time when your computer will be running. I know, it seems obvious... Click 'Next'.



The wizard asks for authentication information. Enter the appropriate username and password for your job to run under. Click 'Next'.



If you have multiple folder pairs and you want all of them to run, you need to select 'Open advanced properties for this task when I click Finish'. Click 'Finish'.




If you want all of your folder pairs to sync on this schedule, modify the 'Run' line to include the -R command.



Well, there you have it. Now you can rest easy knowing your files are synchronizing and your data is safe. Now you can move on to more exciting things, like making a fort for your kids out of a washing machine box or cleaning the dead ladybugs from your light fixtures. At any rate, enjoy the remainder of your day!

Wednesday, November 5, 2008

Clone Your Windows Virtual PC using Sysprep

You have users who utilize Microsoft Virtual PC. You have a standard Windows image. You want to ease the administrative overhead of distributing the image.

The goal here is to have a .vhd file that you can place in a read-only share on your network that your users can use with the least amount of work for you or your user. You must not have conflicting SIDs on the network, and cannot have conflicting computer names. Sysprep is your answer.

Microsoft includes Sysprep on the Windows XP cd. Learning to effectively use this tool will free up your time so you can do something more important (like check out that episode of 'The Office' you missed).

1. Extract the Sysprep tool
Explore your Windows XP CD to the \Support\Tools directory. There you will find a file called deploy.cab. You can double-click on that file, select all files, right-click and choose 'Extract'. You will be able to specify a location for the files. For now, place them in a working directory. You will copy them to the target machine shortly.

2. Create the sysprep.inf file
Run setupmgr.exe, which is a wizard-based application that will create your answer file. If you don't create an answer file, you will have to manually enter the cd key, computer, name, etc. the first time you boot your imaged computer.

3. Copy Sysprep files to your target machine
The Windows system directory needs to have a folder named sysprep in order for the entire process to work. The Windows directory is c:\Windows by default. However, confirm that is consistent with your machine. Copy the following files (the ones you extracted in step 1) to the c:\windows\sysprep folder you just created:
sysprep.exe
setupcl.exe
sysprep.inf
(created in step 2)

4. Sysprep the target machine
Now you're ready for the fun part. Open a command prompt and navigate to your sysprep directory (probably c:\windows\sysprep). You may want to run the following command to familiarize yourself with the different options of sysprep:

sysprep.exe /?


This will display the list of switches available to you. Normally you would not need any of these except for the -noreboot option. This will keep the machine from rebooting when you are done with the Sysprep process. Run the following command:

sysprep.exe -noreboot

Choose the options that suit your needs. The default settings will be sufficient for most users. This process prepares your Virtual PC for cloning. Once this process is complete, your PC will shut down. Now you have your master image.

5. Distribute your cloned .vhd file
Place your .vhd file in a read-only shared directory on your network. This way you can allow access to the file without the risk of someone messing the image up. Your users can copy the file to their physical PC to use it in Virtual PC.

6. Create your new Virtual PC using the cloned .vhd file
Open Virtual PC. Click 'New' to create a new machine. Follow the wizard to create a virtual machine. When you reach the 'Virtual Hard Disk Options' screen, select to use an existing virtual hard disk. Browse to your local copy of the cloned .vhd file.

When you boot the virtual pc the first time, it will access your sysprep.inf file to complete the mini setup. This will require no intervention by you or your users. Now go get that cup of coffee, settle in and watch your 'The Office' episode from last week.