ENTERPRISE
10
3.
Enter the following text to create the main routine:
‘ ********** MAIN **********
‘ Calls all of the other routines...
If UpdateRunning = True Then
RunPatch
RemoveMarker
BootFrozen
Else
If UpdateComplete = False Then
If UserPatchPrompt = True Then
InsertMarker
If Frozen = True Then
BootThawed
Else
RunPatch
RemoveMarker
BootFrozen
End If
Else
‘ Exit Script
End If
Else
‘ Exit Script
End If
End If
The main routine follows the structure of the flowchart. It calls the other routines as
required.
4.
Enter the following text to create the
UpdateRunning
function:
‘ ********** UPDATE RUNNING? **********
‘ Check for marker file. If exists, the update is running. Return True.
Function UpdateRunning
Set objFS = CreateObject(“Scripting.FileSystemObject”)
Set objFolder = objFS.GetFolder(strUNCPath)
Set objRE = new RegExp
objRE.Pattern = strMarkerFile
objRE.IgnoreCase = True
For Each objFile In objFolder.Files
If objRE.Test(objFile.Name) Then
UpdateRunning = True
Exit Function
End If
Next
UpdateRunning = False
End Function
The
UpdateRunning
function checks to see if the marker file exists on the server. If it does, the
updates must be running and the function returns the value of
True
.