Verify after VBS image creation


Author
Message
MGhell
MGhell
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)
Group: Forum Members
Posts: 3, Visits: 2
Hi,

I have the VBS as shown hereinbelow on my desktop in order to quickly create an image.

My question is, is there a switch or something to automatically verify the image after creation?

Thanks

Max


'******************************************************************************
'*
'*
'* Module Name:  Dreammail Daten.vbs
'*
'* Abstract:   This is a template VB Script file generated by Reflect v6
'*      Modify to add your own functionality if required
'*
'*
'******************************************************************************

OPTION EXPLICIT

' call the main function
Call VBMain()


'******************************************************************************
'* Sub:  VBMain
'*
'* Purpose: This is main function to start execution
'*
'* Input: None
'*
'* Output: None
'*
'******************************************************************************
Sub VBMain()
    Dim objShell
    Dim ExitCode

    Set objShell = WScript.CreateObject("WScript.Shell")

' Do the backup
    ExitCode = Backup ("""C:\Program Files\Macrium\Reflect\ReflectBin.exe"" -e -w <BACKUP_TYPE> ""C:\Users\Administrator\Documents\Reflect\Dreammail Daten.xml"" -g")

' done
    Set objShell = nothing
    wscript.quit(ExitCode)
End Sub


'******************************************************************************
'* Function: Backup
'*
'* Purpose: Calls Reflect.exe passing an XML BDF as a parameter
'*
'* Input:  strCmdLine Command Line Arguments
'* Output: Exit Code
'*
'******************************************************************************
Function Backup(Byref strCmdLine)
    Dim objShell
    Dim objExecObject
    Dim iReturnCode

    strCmdLine = Replace(strCmdLine, "<BACKUP_TYPE>", GetBackupTypeParameter)

' Run the backup or image
    Set objShell = WScript.CreateObject("WScript.Shell")
    iReturnCode = objShell.Run(strCmdLine, 1, true)

    if iReturnCode = 2 then
' Handle XML validation error

    elseif iReturnCode = 1 then
' Handle backup error
        objShell.LogEvent 1, "Macrium Reflect - Backup Failed"
    elseif iReturnCode = 0 then
' Everything OK
        objShell.LogEvent 0, "Macrium Reflect - Successful Backup"
    end if
    Backup = iReturnCode
    Set objShell = nothing
End Function

'******************************************************************************
'* Function: GetBackupTypeParameter
'*
'* Purpose: determines the backup type from command line parameter
'*    -full Full backup
'*    -inc Incremental backup
'*    -diff Differential backup
'*
'* Input:  None
'* Output: the parameter
'*
'******************************************************************************
Function GetBackupTypeParameter
    Dim i

    for i = 0 to Wscript.Arguments.Count - 1
      If Wscript.Arguments(i) = "-full" OR _
       Wscript.Arguments(i) = "-inc" OR _
       Wscript.Arguments(i) = "-diff" Then
       GetBackupTypeParameter = Wscript.Arguments(i)
       Exit Function
      End If
    Next

    GetBackupTypeParameter = "-inc"

End Function
Froggie
Froggie
Master
Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)Master (1.7K reputation)
Group: Forum Members
Posts: 999, Visits: 8.6K
MGhell, that VERIFY option (the "switch") resides in the creation of your backup DEFINITION file (Advanced Options) which is used below in your VBS script.  To add the option, just EDIT your Backup DEFINITION via the REFLECT User Interface (your XML file)... the option is under "Advanced Options"

' Do the backup
  ExitCode = Backup ("""C:\Program Files\Macrium\Reflect\ReflectBin.exe"" -e -w <BACKUP_TYPE> ""C:\Users\Administrator\Documents\Reflect\Dreammail Daten.xml"" -g")

Should you need to use that DEFINITION in both a VERIFIED and unVERIFIED use, you'll need to DUPLICATE that Definition, rename it, then edit the renamed definition to add or subtract the Verify option. Now create a separate VBS file, referencing that new Definition rather than the original, and you will have both a VERIFIED or unVERIFIED option depending on which VBS script you use.  They will both work within the same backup chain as originally described in the original Definition file (that part of the copy was not changed).
Edited 21 April 2018 1:38 PM by Froggie
MGhell
MGhell
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)
Group: Forum Members
Posts: 3, Visits: 2
[quote]
Froggie - 21 April 2018 12:22 PM
Thanks, you're right. I forgot to set that option under "advanced properties" :-)

MGhell
MGhell
New Member
New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)New Member (4 reputation)
Group: Forum Members
Posts: 3, Visits: 2
Thanks Froggie
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Login

Explore
Messages
Mentions
Search