Permitting Fallback
Hardware occasionally fails, and you might need to fall back to the old system. You can use RobocopyDataMigration.bat to copy files from the new array back to the old array. That way, you can quickly revert back to the old drives yet provide current user data.
Adapting the Script
You can find RobocopyDataMigration.bat in the Code Library on the Windows Scripting Solutions Web site (http://www.winscriptingsolutions.com). Here are the steps to modify the script for your environment:
- Configure the pathname for the log. In the line
Set LOGLOC=C:\temp
replace C:\temp with your log's pathname.
- Configure the pathname to the resource kit, if necessary. If you've installed the NT resource kit properly, the NT resource kit created an environment variable called NTResKit. To determine whether you have this variable, type
Set
at the command line. If the variable NTResKit appears in the list of variables, you don't need to set a pathname and can skip this step. If you don't see this variable or you've installed the Win2K resource kit, you need to set a pathname. Add the line
Set NTRESKIT=C:\ntreskit
where C:\ntreskit is your resource kit's pathname. (The script specifies where to add this line.) If you've installed the Win2K resource kit, check to see whether the folder name has spaces. If it does, consider reinstalling the resource kit into a folder whose name has no spaces.
- Configure the pathname for the source folder. In the line
Set SOURCE=E:\test\
change test to your source folder's name. Be sure to retain the last backslash. (The pathname must end with a backslash.)
- Configure the pathname for the destination folder. In the line
Set DESTINATION=F:\test\
change test to the name of your destination folder. Be sure to retain the last backslash.
- Configure the top-level folders. In the code that Listing 2 shows, replace Sales Marketing Managers Accounting "Human Resources" Users with the names of your top-level folders. If a folder name includes a space, enclose that name in double quotes. As a general rule, minimize spaces in top-level folders if possible.
- Run the script in a user context that has the necessary permissions to read from the source area and write to the destination area. If you use Task Scheduler to run RobocopyDataMigration.bat, confirm that you're running the script in a user context that has the correct permissions.
A Good Example
As RobocopyDataMigration.bat illustrates, sometimes a script has to do more than perform a task to ensure the success of a major IT undertaking. In the case of RobocopyDataMigration.bat, the script had to create detailed logs, verify results, predict downtime, and permit graceful fallback.