home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
terabyteunlimited.com
/
2014.06.terabyteunlimited.com.tar
/
terabyteunlimited.com
/
ifwbatv2.zip
/
ReadMe.txt
< prev
Wrap
Text File
|
2008-03-06
|
24KB
|
533 lines
Image for Windows Batch Process Scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Table of Contents:
Update Information
General Information
System Requirements
How to Use
Running Multiple Profiles
Additional Information
Known Issues and Caveats
Future Plans
License
Contact Information
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Update Information:
-------------------
March 6, 2008
* Added a means to identify regional date settings from the registry, and
(try to) correctly format it as YYYYMMDD in all cases. The date separator
character is also read, and the script uses whatever it finds, rather than
assuming the separator is "/". Please note that these changes require
that REG.EXE be present. On Windows XP and later, REG.EXE is present
by default. More information is provided under "System Requirements".
February 26, 2008
* Made compatible with Image for Windows v2. Please note that this breaks
compatibility with Image for Windows v1. Please also read ProfileHelp.txt
as there are some important caveats and changes to take note of.
April 18, 2006
* Added support for the new SEQVOLID environment variable, supported by
IFW 1.63.
* Made Profile.cmd a lot easier to read and use, by removing unnecessary
parameters, and moving help information to the external file
ProfileHelp.txt. Because of these changes, you will have to configure the
new Profile.cmd file from scratch, if you used an older version.
* Basically rewrote the entire IFWv2.cmd file, to add more checks for
configuration errors, enhance readability (...maybe), improve error
handling, and make other general improvements.
* Changed the NotifyComplete setting so that it is possible to be nofified
only when an error occurs (and skip notification if everything completed
without error). Please see ProfileHelp.txt for more information.
* Added options to make completion notification dialogs (error and/or
non-error) dismiss themselves automatically.
* Added capability to delete the single oldest backup, using the
Space=oldest setting. This setting overrides the default behavior of the
script, which is to delete however many backups it takes to free up
the predefined amount of free space (per the Space=X setting, where X is
a user-specified number). Use this option carefully, since it will
unquestioningly remove the oldest backup directory each and every time
the script runs!
* Added an option to completely avoid deleting backups automatically. This
can be enabled by using the Space=0 setting, or by simply leaving the
Space option blank (e.g. Space=).
* Fixed optical-drive-related environment variables.
* Added support for all environment variables supported by IFW itself
(at least as of IFW version 1.62b). Please refer to the IFD/IFW PDF
manual, and the ProfileHelp.txt file, for more information. Also added
a MiscEnvVar setting, to provide a stop-gap means of specifying any new
environment variable(s) supported by IFW, without requiring a specific
corresponding setting in the profile.
* Enhanced/expanded error code handling. I realize the error-handling
code may look odd at first glance, but it's done that way for a reason, and
it catches every possible error that IFW can generate (even if the error is
"unspecified").
* Allow for up to 15 command lines (up from 10) to run before/after IFW
runs. Adding even more is pretty easy.
* Allow for up to 25 numbered subdirectories per day, and adding even
more is very easy.
* Many other tweaks and enhancements.
June 2, 2004
* Modified to be usable with optical drives.
March 26, 2004
* Made compatible with IFW 1.30.
February 14, 2004
* Added handling for "Image Stream is Corrupt" errors.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
General Information:
--------------------
Thank you for downloading the Image for Windows Batch Process Scripts. These
scripts are designed to work with Windows 2000 and later. They will not work
on older versions of Windows without significant modification.
Note: These scripts are not compatible with versions of IFW prior to 2.0.
Here is what these batch files can do for you, after you have configured them
appropriately for your own situation:
* Prompt you to run or abort the Image for Windows batch process, before it
begins.
* Check for Administrator privileges, which Image for Windows requires.
* Check to see if the target volume has enough free space before running
Image for Windows, and automatically delete the oldest backup(s) if more
room is needed.
* Automatically run programs before Image for Windows itself runs. For
example, you may want to empty your Recycle Bin, run CHKDSK on the target
partition, or carry out other small tasks before running IFW.
* Automatically run programs after Image for Windows completes, either
unconditionally or only if Image for Windows exits without an error. For
example, you can have Notepad open the log file that is generated by these
scripts.
* Automatically create a new backup directory name, and create that directory
under your specified backup parent directory. The format of the directory
name is YYYYMMDD (e.g. 20050620), because that format makes sense in terms
of recognition, organization, and sortability.
* Automatically create numbered subdirectories under the aforementioned
YYYYMMDD directory, if needed. For example, if you created the directory
"D:\Backups\20050620" during a previous Image for Windows batch process, a
second run will move the image files in that directory to
"D:\Backups\20050620\001", and will put the new image files in
"D:\Backups\20050620\002". If the batch process is run yet again on the
same date, the files will then be placed in "D:\Backups\20050620\003" ...
and so on, up to a current maximum of 25 (which can be increased, if
needed).
* Run Image for Windows with whatever parameters you specify.
* Log everything that is done (start of batch process, directory creation,
old backup directory deletion, starting of Image for Windows, termination
of Image for Windows, errors, and so on).
* Notify you, with a dialog, upon completion of the batch process.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
System Requirements:
--------------------
In order for these scripts to work properly, your system must meet the following
requirements:
* You must be running Windows 2000 or later.
* You must have Image for Windows 2.x installed. These scripts will not work
with Image for Windows 1.x. Scripts that will work with IFW v1.x can be
obtained at http://www.terabyteunlimited.com/downloads/IFWBatch.zip.
* You must run the scripts with the .CMD file extension, and not .BAT. This
is very important! It may sound crazy, but it does make a difference in
how Windows interprets some of the code.
* You must NOT have any data set for the Autorun registry value under the
key "HKEY_CURRENT_USER\Software\Microsoft\Command Processor". Strange
errors and problems can occur if you do.
* The Windows file REG.EXE must be present. This file is present under
Windows XP and later by default. Under Windows 2000, you must either
download a copy of REG.EXE, or extract it from SUPPORT.CAB on your Windows
2000 CD-ROM.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to Use:
-----------
1. Place IsAdmin.exe, IsFree.exe, and MsgBox.exe in a directory that is
specified in your system or user PATH environment variable. To easily
determine which directories are defined in the PATH environment variable,
run the command "echo %path%" from a command prompt. If in doubt, simply
put IsAdmin.exe, IsFree.exe, and MsgBox.exe in your Windows directory.
2. Place IFWv2.cmd, Profile.cmd, ProfileHelp.txt, and ReadMe.txt in the desired
directory (or directories). The simplest thing to do is to keep them all in
a single directory. Putting all the .TXT and .CMD files in your Image for
Windows installation directory is recommended (for simplicity), but you
don't have to do so.
3. Open Profile.cmd in a text editor, and set it up as desired. Refer to
ProfileHelp.txt as needed. When done, you can begin the IFW batch process
by running your configured copy of Profile.cmd.
The idea is to make changes only to Profile.cmd, and to keep IFWv2.cmd unchanged.
For each partition (or imaging scheme) you want to back up with Image for
Windows, you should have a different copy of Profile.cmd, with the appropriate
customizations inside. The profile files can be moved or renamed** to wherever
and whatever you want, but if you move or rename** IFWv2.cmd, make sure you refer
to it properly in all of your profile scripts, using the IFWScriptPath
parameter.
** If you rename one or both scripts, you must keep the .CMD extension. They
will not function correctly with the .BAT extension!
For example, let's assume you use Image for Windows to create images of two of
your partitions, C: (the "Windows" partition) and D: (the "Data" partition).
Here's how you might use these scripts to handle things:
1. Create a copy of Profile.cmd and name it Windows.cmd. Configure the
SET parameters in Windows.cmd to meet your needs for imaging the C:
partition. When you want to run Image for Windows on the C: partition,
simply run Windows.cmd, and it will automatically call IFWv2.cmd using the
parameters you specified in Windows.cmd.
2. Create another copy of Profile.cmd, and name this one Data.cmd.
Configure the SET parameters in Data.cmd to meet your needs for imaging
the D: partition. When you want to run Image for Windows on the D:
partition, simply run Data.cmd, and it will automatically call IFWv2.cmd
using the parameters you specified in Data.cmd.
Keep in mind that if you use the same parent backup directory for multiple
profiles (i.e. the BackupParentDir setting in Profile.cmd), then each profile,
when invoked, could affect the image files for the other profile(s). For this
reason, you may want to use a different BackupParentDir setting for each profile
in use.
You should not run IFWv2.cmd directly. It won't hurt anything, but it won't work,
either.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Running Multiple Profiles:
--------------------------
If you want to run multiple profiles (i.e. imaging operations) at a time, either
manually or using the Windows Task Scheduler, you have two options, each of which
will be explained below:
* Option 1: Configure the desired profiles, each in a separate copy of
Profile.cmd, and then create a separate script to CALL each Profile.cmd in
succession. To run all the desired profiles, you would run the script you
created.
* Option 2: Create multiple profiles within a single copy of Profile.cmd. To
run all the desired profiles, you would simply run Profile.cmd as normal.
Option 1 - Running Separate Copies of Profile.cmd from a Script:
1. Configure a separate copy of Profile.cmd for each imaging operation you wish
to perform, as explained elsewhere in this document. The recommended
approach is to give each copy of Profile.cmd a different name, and to store
all of the profiles in a single directory.
** Be sure to use a different BackupParentDir setting for each profile, or
unexpected results could occur.
2. Use a text editor to create a new script that will invoke each profile in
turn. This is done using one CALL statement for each profile. Here is an
example script:
@echo off & cls & setlocal
call "C:\Program Files\Image for Windows\Windows.cmd"
call "C:\Program Files\Image for Windows\Data.cmd"
call "C:\Program Files\Image for Windows\Media.cmd"
:: End of script
** The "@echo off & cls & setlocal" line isn't required, but is recommended.
3. Save the script with the .CMD extension (e.g. FullDisk.cmd).
4. If you wish to run the multiple profiles using the Windows Task Scheduler,
create a new scheduled task, and supply the path to the script you created
above (e.g. FullDisk.cmd). To run the profiles manually, simply run that
script directly.
Option 2 - Creating Multiple Profiles Within a Single Copy of Profile.cmd:
1. Open the script Profile.cmd in a text editor such as Notepad.
2. You will need to duplicate a portion of Profile.cmd, using the copy and
paste functions. Do this by selecting and copying everything beginning
with (and including) this line:
:: <---- START OF PROFILE ---->
And ending with (and including) this line:
:: <---- END OF PROFILE ---->
3. Paste the content you just copied immediately below the last instance of
this line:
:: <---- END OF PROFILE ---->
You should end up with the following general Profile.cmd content:
:: <---- START OF FIRST PROFILE ---->
(profile content, including SET commands, commented lines, and some other
batch commands.)
:: <---- END OF FIRST PROFILE ---->
:: <---- START OF SECOND PROFILE ---->
(profile content, including SET commands, commented lines, and some other
batch commands.)
:: <---- END OF SECOND PROFILE ---->
Please note that as shown above, you can manually enter identifying names
for each profile (e.g. "FIRST", "SECOND").
4. Repeat step 3 for each additional imaging operation you wish to carry out
using the Image for Windows batch process scripts. Each profile (i.e. each
imaging operation) must have its own SET commands.
5. Configure each profile accordingly. Please refer to ProfileHelp.txt for
more information on configuration.
** Be sure to use a different BackupParentDir setting for each profile, or
unexpected results could occur.
6. If you wish to run the multiple profiles using the Windows Task Scheduler,
create a new scheduled task, and supply the path to the copy of Profile.cmd
you just configured. Please note that you can rename Profile.cmd, if
desired, as long as you reference it correctly in Task Scheduler. To run
the profiles manually, simply run Profile.cmd.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Additional Information:
-----------------------
The IsAdmin.exe, IsFree.exe, and MsgBox.exe utilities are provided courtesy of
Douglas Good ( http://www.otbsw.com ). His utilities are distributed here with
his explicit permission.
Place IsAdmin.exe, IsFree.exe, and MsgBox.exe in a directory which is specified
in your system or user PATH environment variable. If in doubt, simply put them
in your Windows directory.
IsAdmin.exe -- Checks whether the associated user has Administrator rights on
the local machine.
IsFree.exe -- Checks if a drive has the specified amount of free space.
MsgBox.exe -- Displays simple message boxes, to provide feedback or prompt
for user input. This program is used extensively by the IFW
Batch Process Scripts.
Please note: None of these programs will make changes to your system--they do
not alter the file system or the registry in any way when run.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Known Issues and Caveats:
-------------------------
* Specify your profile settings carefully! The scripts do not check for all
possible configuration errors. For example, it would not be valid to specify
something like ImageName=\Backup for the ImageName setting (the backslash is
invalid). While it is possible to verify settings more than is currently done,
doing so would probably not be a good trade-off in terms of script size,
complexity, and maintainability.
* Currently, the scripts REQUIRE that IsAdmin.exe, IsFree.exe, and Msgbox.exe
each exist in a directory specified in the system or user PATH environment
variable. This is true even if you don't wish to use one or more of them.
* Currently, the scripts check to see if an instance of IFW is already running,
before attempting to begin the imaging operation. However, the scripts do
not yet check whether or not another instance of the scripts themselves are
running. (See "Future Plans" for more information on that.) So, be very
mindful not to run more than one copy of the scripts at a time.
* If so configured, and if free space needs dictate, the scripts will
automatically delete as many old backup directories as are necessary in an
attempt to recover enough free space for the new image to be created. To
this end, all directories and files under the directory specified in the
BackupParentDir setting are fair game. (No other directories or files are
EVER deleted by these scripts.) Because of this, you should carefully note
the following:
- You should configure the Space setting in the profile script carefully.
If, for example, you specify a number that is too high, the scripts may
delete ALL existing backups under BackupParentDir, in an attempt to gain
enough free space to continue.
- The caveat expressed immediately above also applies in the situation
where the target volume's free space is reduced by the addition of
other, unrelated files.
- If you would like for the oldest single backup to always be deleted prior
to the creation of a new backup, use Space=oldest in the profile script.
This prevents any uncertainty in the number of old backups that will be
deleted, but it does so at the expense of knowing prior to the imaging
operation whether or not enough free space will be available for it to
complete successfully. Again, use Space=oldest with caution, because it
will ALWAYS delete the oldest backup.
- You should not configure the scripts to save log files in directories that
may be deleted at some point (unless, of course, you want that to occur).
- You should not manually place directories or files in the backup directories
created by the scripts (again, unless you want them to be deleted).
- You should generally not rename the directories that are created by the
scripts. If you do, unexpected results may occur.
- Last, but not least, you should keep secondary backups as needs dictate.
For example, even if you normally save all images to a hard drive, you may
want to make a habit of burning a copy of the same backup to DVD or some
other media (even another hard drive).
* The message "INFO: No tasks running with the specified criteria." appears
shortly after the main script begins running (so long as IFW isn't running).
This is normal, and is the output of TASKLIST.EXE, which is invoked by the
script to see if IFW (specifically, IMAGEW.EXE) is running.
* If you receive the error stating that a directory could not be deleted, make
sure no application has that directory, or any of its subdirectories or files,
open. This includes Explorer windows and TBIView, for example.
* If you use the RunPriorXX, RunAfterAlwaysXX, and/or RunAfterCondXX settings
in the profile script, be aware that you generally need to use the
"START "" /WAIT" command format in order to halt processing until the process
you have launched completes. If you wish to run a separate script using these
settings, you may want to run CMD.EXE and pass the script as a parameter to it
(e.g. START "" /WAIT CMD.EXE /C "D:\SCRIPTS\RUNTHIS.CMD").
* If the scripts create a new directory, then an error occurs (before or after
IFW runs), the newly-created directory remains, but will not be used the next
time (even if it is empty). This behavior may be changed in the future.
* In some cases, empty YYYYMMDD directories are not removed. This will be fixed
in a future release. In the meantime, you can either delete affected
directories manually, or use Doug Good's "Remove Empty Folders" (RmEmpty)
command line utility, available from http://otbsw.com. This could be done
with a RunAfterAlwaysXX variable and the command line:
rmempty.exe "%BackupParentDir%"
* Some commands specified in the Autorun registry value under
"*\Command Processor" may result in unexpected behavior when the script is
run. (This key and value can appear in various locations in the registry.)
If you are seeing strange behavior when the script is run, and you have an
Autorun value set, try clearing out the Autorun value(s). Until this issue
is addressed, you may want to leave the Autorun values blank to prevent
unexpected behavior.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Future Plans:
-------------
* Remove requirement for IsAdmin.exe, IsFree.exe, and MsgBox.exe, and make the
checking that is done on these files optional.
* Add a semaphore to prevent multiple copies of the scripts from running at a
given time.
* Add a NeverDeleteMoreThan option to prevent more than the specified number
of old backups from being deleted when Space=X is used (where X is a number).
* Add a "verbose logging" option, which will log all settings used when the
scripts are run.
* Make it possible to locate IMAGEW.EXE using the AppPaths registry key, rather
than having to include the full path in the profile script.
* Provide an option to automatically delete newly-created directories if the
process ends with an error.
* Change "Image for Windows is running..." message to reflect RunPriorXX and/or
RunAfterPriorXX and/or RunAfterAlwaysXX commands, when appropriate.
* Implement a more elegant means of handling numbered subdirectories (more
elegant than hard-coding, that is), and allow for the creation of an
essentially unlimited number of them.
* Use CMD /D to prevent Autorun values from being an issue.
* Document and restructure the code.
None of the above is set in stone...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
License:
--------
Please refer to FWLIC.TXT, which was included in this package.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Maintainer Information:
-----------------------
Scott Danesi
dt9oqsa02@sneakemail.com
If you think you have found a problem in the script(s), please:
* Include a copy of ALL the scripts in use when sending an email, even if you
have not knowingly made changes to them. Archiving the files with the 7Z, RAR,
or ZIP format is recommended.
* Mention exactly which path(s) you were running the scripts from.
* Mention what exact version of Windows you are using the scripts on.
* Mention what exact version of IFW you are using the scripts with.
* Explain what the problem is, in as much detail as is reasonably possible.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (c) 2008 TeraByte, Inc. All Rights Reserved.
End of document