Macrium Support Forum

This forum is for Version 5 of Macrium Reflect.
Version 6 users should join our new forum here.

Version 5 support expired on 17 February 2016.

Find out more
Macrium Support Forum
Macrium Support Forum    RSS 2.0  RSS Feed      KB
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 Reflect v4
 File Backup
 Auto shutdown fails after successful backup
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

rib-rider
Starting Member

United Kingdom
9 Posts

Posted - October 24 2011 :  20:13:21  Show Profile
I've tried this a few times now and each time it has refused to work. The log file shows that the backup was created successfully and I can confirm that by checking the disk partition. However, the shutdown is not called and it is not shown in the log file.

The result is that after the backup, the PC continues to run.

Unfortunately I don't see a way to attached the vbs file to this post, although to my unknowledgeable eyes the script looks fine.

I'm running winxp - sp3. Processor is AMD Athlon (tm) 11 X4 630, 786MHz with 3.25GB of RAM.

Otherwise it's a great programme and does what it says on the tin.

Any ideas why the shutdown call fails?

Cheers
rib-rider
javascript:insertsmilie('')

Merlin
Advanced Member

852 Posts

Posted - October 25 2011 :  00:46:43  Show Profile
You can either copy and paste the code here (deleting any license key or email addresses/passwords), or attach it to an email to support (at) macrium.com
Go to Top of Page

rib-rider
Starting Member

United Kingdom
9 Posts

Posted - October 25 2011 :  12:58:34  Show Profile
Hi, the complete VBS script is shown here

'******************************************************************************
'*
'*
'* Module Name: FULL DATA BACKUP DRIVE M.vbs
'*
'* Abstract: This is a template VB Script file generated by Reflect v4.2
'* 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\reflect.exe"" -e -w ""C:\Documents and Settings\John\My Documents\Reflect\FULL DATA BACKUP DRIVE M.xml""")

' Issue shutdown command
objShell.Run "shutdown -s"

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

'******************************************************************************
'* Function: Backup
'*
'* Purpose: Calls Reflect.exe passing an XML BDF as a parameter
'* Optionaly logs output to file
'*
'* Input: strCmdLine Command Line Arguments
'* Output: Exit Code
'*
'******************************************************************************
Function Backup(Byref strCmdLine)
Dim objShell
Dim objExecObject
Dim strLine
Dim objFS
Dim objNewFile
Dim strLogFileName


' Run the backup or image
Set objShell = WScript.CreateObject("WScript.Shell")
Set objExecObject = objShell.Exec(strCmdLine)

' Log to file
strLogFileName = "C:\Documents and Settings\John\My Documents\Reflect\log-" & Year(Date) & "-" & Month(Date) & "-" & Day(Date) & " " & Hour(Time) & "." & Minute(Time) & "." & Second(Time) & ".txt"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objNewFile = objFS.OpenTextFile(strLogFileName , 8, 1)
Do Until objExecObject.StdOut.AtEndOfStream
strLine = objExecObject.StdOut.ReadLine()
If Instr(strLine , "%") = 0 Then
objNewFile.WriteLine strLine
end if
Loop

objNewFile.Close
set objFS = nothing

' Wait for the process to finish
Do While objExecObject.Status = 0
WScript.Sleep 100
Loop

if objExecObject.exitcode = 2 then
' Handle XML validation error

elseif objExecObject.exitcode = 1 then
' Handle backup error
elseif objExecObject.exitcode = 0 then
' Everything OK
end if
Backup = objExecObject.exitcode
Set objExecObject = nothing
Set objShell = nothing
End Function

Cheers
Rib-rider
Go to Top of Page

Nick
Moderator

United Kingdom
6303 Posts

Posted - October 26 2011 :  19:40:11  Show Profile
Hi

Thanks for your post.

The shutdown command looks fine. Try starting a command prompt and typing:

shutdown -s

Kind Regards

Nick - Macrium Support

Go to Top of Page

rib-rider
Starting Member

United Kingdom
9 Posts

Posted - October 27 2011 :  08:43:34  Show Profile
Hi,
Shutdown using the Command prompt works.

I also ran two other programs using auto-shutdown; Avira and Easeus and they both worked fine.

However, I did note this morning, after using Macrium with auto shutdown last night that the online armor firewall had been effectively been reset. It was left last night with "block all network traffic" enabled and this morning it had been disabled, which could point to not a shutdown but a re-boot. I'll have to witness that action to confirm it, which I'll try again tonight. However, is there anything in the script, or anywhere else that might cause a re-boot instead of a shutdown?

regards
rib-rider

Go to Top of Page

Nick
Moderator

United Kingdom
6303 Posts

Posted - October 27 2011 :  16:30:10  Show Profile
Hi rib-rider

quote:
However, is there anything in the script, or anywhere else that might cause a re-boot instead of a shutdown?


There's nothing in the script that could cause a reboot. It may be worthwhile looking in your Windows event log to see if anything stands out there.

Kind Regards

Nick - Macrium Support

Go to Top of Page

rib-rider
Starting Member

United Kingdom
9 Posts

Posted - October 27 2011 :  22:22:17  Show Profile
Hi Nick,
Tonight I ran another backup with shutdown enabled and found exactly the same problem. So I disconnected the PC from the internet and disabled the Online Armor firewall. I then repeated the backup and the shutdown worked.

I then re-enable OA and looked at the total history this evening where I was unable to find any request to run the vb script. So in the the program options section of OA there's a check box entitled "prompt when running unkown programs" which I don't recall ever having checked. When I ran the back up again OA requested permission to enable the vb script. The backup then worked correctly and the PC shut down.

I tried it on the other backups with auto-shutdown scripts including the one at the head of this mail trail and they all worked correctly.

So problem solved.
Cheers
rib-rider
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
Macrium Support Forum © Paramount Software UK Ltd Go To Top Of Page
This page was generated in 1.12 seconds. Snitz Forums 2000