' ******************************************************* ' **** Check if computer is on the network ************** ' ******************************************************* strHost = "ngky-z99-sanmgt" Const OpenAsASCII = 0 Const FailIfNotExist = 0 Const ForReading = 1 Dim objShell, objFSO, sTempFile, fFile Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") sTempFile = objFSO.GetSpecialFolder(2).ShortPath & "\" & objFSO.GetTempName objShell.Run "%comspec% /c ping.exe -n 2 -w 500 " & strHost & ">" & sTempFile, 0 , True Set fFile = objFSO.OpenTextFile(sTempFile, ForReading, FailIfNotExist, OpenAsASCII) Select Case InStr(fFile.ReadAll, "TTL=") Case 0 IsAlive = False WScript.Quit() Case Else IsAlive = True 'msgbox"on network" End Select fFile.Close objFSO.DeleteFile(sTempFile) Set objFSO = Nothing Set objShell = Nothing ' ******************************************************* ' **** Check if there is a scheduled job ************** ' ******************************************************* Dim v2iAuto Dim oNet Dim oCurrentJob ' ' Step 1: Create a VProRecovery automation object ' Set v2iAuto = CreateObject("Symantec.ProtectorAuto") ' ' Step 2: Connect to the local agent ' WScript.Echo "Connecting..." Set oNet = CreateObject("Wscript.Network") Call v2iAuto.Connect(oNet.ComputerName) ' ' Step 3: Iterate over all image jobs and remove each one ' For Each oCurrentJob in v2iAuto.ImageJobs msgbox"There is a scheduled backup job!" WScript.Sleep 100 ' allow console time to refresh if it's running Next ' ******************************************************* ' **** Check for missed backup ************** ' ******************************************************* ' ******************************************************* ' **** Run scheduled job ************** ' *******************************************************