Pre- and Post-commands, enable the users to perform specific tasks before and after the backup job. You can activate the use of these commands from the Backup Settings Page; (i.e. step 4 of the backup process):

With these commands, the user is able to perform the following:
- Check Disk drives (chkdsk)
- Copy files (copy)
- Copy files and folders (xcopy)
- Defragment a Drive (defrag)
- Disk copy Removable Disks (diskcopy)
- Move files (move)
- Print documents (print)
- Replace files (replace)
- Shutdown, log off or restart the computer (shutdown)
Check Disk drives (chkdsk):
Chkdsk lists and corrects errors on the disk. Chkdsk’s general form as follows:
chkdsk volume: path\ filename /f
For example, if you want to check drive d and have windows fix any errors on it type:
chkdsk d:\ /f
Notes:
* chkdsk cannot function on a locked files used by other programs.
* Path and filename optional, chkdsk can be performed on a drive.
* /f is used to enable windows to fix the errors on the drive and can be omitted.
Copy files (copy)
Copy copies one or more file to a destination, copy’s general form as follows:
copy Source + Source + ... Destination
For example, if you want to copy contact.txt and info.doc that are on drive you’re your desktop type:
copy “c:\contact.txt” + “c:\info.doc” “C:\Documents and Settings\%username\Desktop\”
If you want to copy the log file to drive C you can write:
copy “$LOGFILE$” “c:\“
Notes:
- copy command can only copy files and cannot copy files with 0KB size, use xcopy to perform that task.
Copy files and folders (xcopy)
Xcopy copies files and folders in the source to the destination, xcopy’s general form as follows:
xcopy Source Destination
For example, if you want to copy the contents of a folder named backups on c drive to the desktop type:
Xcopy “c:\backups” “C:\Documents and Settings\%username\Desktop\”
Defragment a Drive (defrag)
Locates and consolidates fragmented boot files, data files, and folders on local volumes.
For example, if you want to defragment drive c type:
defrag c:
Note:
You cannot defragment volumes that the file system has marked as dirty, which indicates possible corruption. You must run chkdsk on a dirty volume before you can defragment it.
Disk copy Removable Disks (diskcopy)
This command is used to Copy the contents of the floppy disk in the source drive to a formatted or unformatted floppy disk in the destination drive.
For example, if you want to copy the floppy in drive A to the floppy in drive B type:
diskcopy a: b:
Move files (move)
This command is used to move one or more than one file to a specified directory
For example, if you want to move the main backup file/folder to drive c type:
move “$BACKUPOUTPUT$” c:\
Replace files (replace)
replace command replaces files in the destination directory with files in the source directory that have the same name. You can also use replace to add unique file names to the destination directory.
For example, if you want to replace a file named backup.txt in c drive with the backup.txt on the desktop, type the following:
replace “C:\Documents and Settings\%username\Desktop\backup.txt” C:\
Shutdown, log off or restart the computer (shutdown)
This command is used to shutdown, log off, or restart the local computer or remote computer.
- To shutdown the computer type:
shutdown -s -f –m \\computername
- To log off the computer type:
shutdown -l -f -m \\computername
- To restart the computer type:
shutdown -r -f -m \\computername
Note: to shutdown, log off, or restart from the local computer omit “–m \\computername” from the commands above.
* To delay the shutdown procedure in order for the user to abort shutdown, you can proceed with the following steps:
- In the post command, type shutdown -s –t XX ; where XX is the number of seconds to delay the shutdown.
- To abort during shutdown please follow these steps:
- from start, go to run and type cmd, a command prompt window will appear
- type shutdown –a, this will abort the shutdown while in process.
|