Macrium Support Forum

Cannot select backup type (full, inc, diff) in MS-DOS Batch File schedule

https://forum.macrium.com/Topic32772.aspx

By GaryZ - 5 December 2019 9:49 PM

In MS-DOS Batch File schedule Full type is always selected by Macrium Reflect when adding a schedule. There is no option in to select the type when scheduling, unlike the schedule in the backup definition file.

The only way to use the batch file with the various back types seems to require a switch within the batch file (-inc, -full, -diff). E.g. "C:\program files\macrium\reflect\reflectbin.exe" -e -w -inc ... "

How can I avoid creating three separate batch files for each switch (full, inc and diff)?



By jphughan - 5 December 2019 10:12 PM

You could have the batch file prompt you and capture the user's response as a variable that would be used to determine the syntax of the call to Reflect, specifically the backup type parameter that gets included, but then the batch file can't run non-interactively anymore.  Or you could have Reflect generate a VBScript or PowerShell script file to run your backups instead, either of which allow you to set schedules for those different types of backups.  Macrium actually discourages the use of batch files anyway because they have a lot of limitations that don't apply to VBScript or PowerShell scripts.  Is there some reason you have to use a batch file?  If you need help translating something in your batch file to PowerShell, I may be able to help.
By GaryZ - 6 December 2019 3:32 AM

jphughan - 5 December 2019 10:12 PM
You could have the batch file prompt you and capture the user's response as a variable that would be used to determine the syntax of the call to Reflect, specifically the backup type parameter that gets included, but then the batch file can't run non-interactively anymore.  Or you could have Reflect generate a VBScript or PowerShell script file to run your backups instead, either of which allow you to set schedules for those different types of backups.  Macrium actually discourages the use of batch files anyway because they have a lot of limitations that don't apply to VBScript or PowerShell scripts.  Is there some reason you have to use a batch file?  If you need help translating something in your batch file to PowerShell, I may be able to help.

Following your answer I tried the generated VBScript, that works out much better for me. Now I can select the backup type when scheduling VBScript. Thanks.

Another advantage using VBScript is a RoboCopy call is included in the generated VBScript file. (I'm going to add a /log and UNC paths to the RoboCopy call.) Previously I was using my old batch RoboCopy scripts to call RoboCopy, which I didn't want to rewrite, and now I don't need to..