Re: Backup up system state with NTbackup through a VB script (I need error checking) by rhorn
rhorn
Fri May 21 07:20:27 CDT 2004
rhorn@drivefinancial.com (Robert) wrote in message news:<f9cf3e7d.0405200708.4e5f2add@posting.google.com>...
> I am currently backing the system state on various machines with
> ntbackup that is launched through a VB script. The script also sends
> e-mails when its completed. What I need to do is add code that does
> error checking for when ntbackup fails.Instead of sending an e-mail
> when it completes I need to change it to send one when it fails. Does
> anyone have any code out there that does that? Any help would be
> appreciated.
>
> Thanks
> Robert
This is the code I am using to run it :
This is what I need to do error checking on (whether NTBackup
completes successfully or not)
Set objUser = WScript.CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")
objName = objUser.GetTempName
objTempFile = objName
objShell.Run "cmd /c C:\Windows\system32\NTBACKUP.exe backup_
\\dfstxfs3\q$\dhcp\backup /v:yes /r:no /rs:no /hc:off /m normal_
/j DFSTXFS3_DHCP_Database_Backup /l:s_
/fc:\DHCP\DHCP_Database_Backup.bkf" ,8,True
what I need to do is to be able to send an e-mail when it fails and
one when it completes. The email part I have but the error checking is
the problem