bilbonvidia
Technical User
Is it possible to run a script once a scheduled backup has finished? I would like to run a batch file once the backup is complete.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
[green]
'==========================================================================
'
' NAME: MonitorProcess.vbs
'
' AUTHOR: Mark D. MacLachlan , The Spider's Parlor
' URL: [URL unfurl="true"]http://www.thespidersparlor.com[/URL]
' DATE : 4/17/2007
' COPYRIGHT (c) 2007 All Rights Reserved
'
' COMMENT:
'
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
' ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To
' THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
' PARTICULAR PURPOSE.
'
' IN NO EVENT SHALL THE SPIDER'S PARLOR AND/OR ITS RESPECTIVE SUPPLIERS
' BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
' DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
' WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
' ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
' OF THIS CODE OR INFORMATION.
'
'==========================================================================[/green]
Option Explicit
Dim objWMIService, objProcess, colProcess, pFound, strProcess
Dim strComputer, strList
strComputer = "."
strProcess = "NTBackup.exe"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
pFound = "Search"
Do While pFound <> False
Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")
For Each objProcess in colProcess
If objProcess.Name = strProcess Then
pFound = True
End If
Next
If pFound = "Search" Then
pFound = False
ElseIf pFound = True Then
pFound = "Search"
End If
WScript.Sleep 10
Loop
WSCript.Echo strProcess & " stopped " & Now
WScript.Quit
@echo off
ntbackup <your commandline for backup job here>
call <your batchfile path & name here>