@echo off cls if (%1)==() goto noDriveSpecified echo -------------------------------- echo Backing up Programs n Resources echo -------------------------------- IF EXIST "%1:\Programs & Resources.bkf" ( ntbackup backup "D:\Programs & Resources.bkf" /J "Programs & Resources" /M incremental /F "%1:\Programs & Resources.bkf" /L:s ) ELSE ( ntbackup backup "D:\Programs & Resources" /J "Programs & Resources" /M normal /F "%1:\Programs & Resources.bkf" /L:s ) echo --------------------- echo Backing up Essentials echo --------------------- IF EXIST "%1:\Essentials.bkf" ( ntbackup backup "D:\Essentials" /J "Essentials" /M incremental /F "%1:\Essentials.bkf" /L:s ) ELSE ( ntbackup backup "D:\Essentials" /J "Essentials" /M normal /F "%1:\Essentials.bkf" /L:s ) echo ------------------------------ echo Backing up Non Technical Books echo ------------------------------ IF EXIST "%1:\Non Technical Books.bkf" ( ntbackup backup "D:\Non-Technical Books" /J "Non-Technical Books" /M incremental /F "%1:\Non Technical Books.bkf" /L:s ) ELSE ( ntbackup backup "D:\Non-Technical Books" /J "Non-Technical Books" /M normal /F "%1:\Non Technical Books.bkf" /L:s ) goto end :noDriveSpecified echo FORMAT: backup <driveletter> :end
The problem with this are
- For the first time, the FULL backup is performed correctly. For second & subsequent times, the backup archive is reduced to a small sized file.
- If no parameter is passed, I expected the script to display the format of the command. But, instead it shows "The syntax of the command is incorrect".