home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 June / PCpro_2006_06.ISO / files / mstools / Shared_Computer_Toolkit_ENU.msi / FileInclude011 < prev    next >
Encoding:
Text (UTF-16)  |  2006-02-23  |  77.3 KB  |  1,064 lines

  1. ' ***
  2. ' *** --------------------------------------------------------------------------
  3. ' *** Filename:        DiskProtect.vbs
  4. ' *** --------------------------------------------------------------------------
  5. ' *** Description:    Code for the Windows Disk Protection HTA
  6. ' *** --------------------------------------------------------------------------
  7. ' *** Version:        1.0
  8. ' *** Notes:        Used by DiskProtect.hta
  9. ' *** --------------------------------------------------------------------------
  10. ' *** Copyright (C) Microsoft Corporation 2005, All Rights Reserved
  11. ' *** --------------------------------------------------------------------------
  12. ' ***
  13.  
  14. ' ~~~ 
  15. ' ~~~ Force variables to be declared and turn off script error messages unless in DEBUG mode
  16. ' ~~~ 
  17. Option Explicit
  18. If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  19.  
  20. ' ~~~
  21. ' ~~~ Declare variables
  22. ' ~~~
  23. Dim oDiskProtect, iWDPcmdVer
  24. Dim AVscriptPath,OtherscriptPath
  25. Dim strActionMessage, sRootFolder
  26. Dim oOS, colOperatingSystems, iInstallTime, iLastBootUpTime
  27. Dim sUpperFilter, iLocalDateTime, oLog, bBlackList, bWhiteList
  28. Dim arrTempArray, i, arrUpperFilters()
  29.  
  30. ' ***
  31. ' *** ---------------------------------------------------------------------------
  32. ' *** Name:            Init()
  33. ' *** ---------------------------------------------------------------------------
  34. ' *** Purpose:        This function is executed before Load.
  35. ' *** ---------------------------------------------------------------------------
  36. ' ***
  37. Sub Init()
  38.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  39.     Dim iOverlayTime
  40.  
  41.     iWDPcmdVer = 1
  42.  
  43.     ' ~~~ Create objects
  44.     Set oDiskProtect = New DiskProtect
  45.     Set oLog         = New Logging
  46.     sRootFolder       = GetRootFolder
  47.  
  48.     'Lets call AdminMessage.exe to throw up a message if the machine was shut down by ThresholdMonitor
  49.     call oShell.Run(chr(34) & "%sctpath%\bin\AdminMessage.exe" & chr(34), 0, false)
  50.     
  51.     ' ~~~ Initiate logging & bind the logging object to the restrictions object
  52.     Call oLog.Open(sRootFolder & "\log\DiskProtect.hta.log")
  53.     Call oLog.Write("DiskProtect.hta : Started")
  54.     oDiskProtect.Logging = oLog
  55.  
  56.     ' ~~~ Check reboot key before trying to run tool
  57.  
  58.     Set colOperatingSystems = oWMIService.ExecQuery _
  59.         ("Select * from Win32_OperatingSystem")
  60.     For Each oOS in colOperatingSystems
  61.         iLastBootUpTime = oOS.LastBootUpTime
  62.         iLocalDateTime = oOS.LocalDateTime
  63.     Next
  64.  
  65.     iInstallTime = RegRead(TOOLKITKEY & "SCTInstallTime")
  66.     iOverlayTime = RegRead(TOOLKITKEY & "SCTOverlayTime")
  67.  
  68.     ' ~~~ Check UpperFilter registry key to ensure no other Disk Protection Software is installed
  69.     ' ~~~ Read and record UpperFilters key in SCT registry
  70.     oDiskProtect.GetStashUpperFilterKey()
  71.  
  72.     On Error Resume Next
  73.  
  74.     ' ~~~ Check only if Ewf not in UpperFilter
  75.     If (InStr(UCase(sUpperFilter),","&"EWF"&",") < 1) or IsNull(sUpperFilter) Then
  76.  
  77.         ' ~~~ Set to Ewf if NUll
  78.         If IsNull(sUpperFilter) Then
  79.             ReDim Preserve arrUpperFilters(0)
  80.             arrUpperFilters(0) = "Ewf"
  81.  
  82.             ' ~~~ Writes to UpperFilters key
  83.             oDiskProtect.WriteUpperFilterKey()
  84.  
  85.             ' ~~~ Read and record UpperFilters key in SCT registry
  86.             oDiskProtect.GetStashUpperFilterKey()
  87.  
  88.             ' ~~~ Registry modified... prompt for Restart
  89.             If MsgBox(document.all("resRebootMessage").innerHTML, vbYesNo + vbCritical, sTitle) = vbYes Then
  90.                 bProcessing = False
  91.                 call Self.Close
  92.                 oDiskProtect.Reboot
  93.                 TerminateHTA()
  94.                 Exit Sub
  95.             Else
  96.                 bProcessing = False
  97.                 call Self.Close
  98.                 TerminateHTA()
  99.                 Exit Sub    
  100.             End If
  101.         Else
  102.             ' ~~~ Black List Check
  103.             Call oDiskProtect.UpperFilterCheck("BlackList")
  104.  
  105.             If bBlackList Then
  106.                 ' ~~~ Warn of Blacklist hit... Exit!
  107.                 msgbox vbCrlf & document.all("resDiskProtectionSoftware1").innerHTML & vbCrlf & document.all("resDiskProtectionSoftware2").innerHTML,vbOKOnly + vbInformation, sTitle
  108.                 bProcessing = False
  109.                 call Self.Close
  110.                 TerminateHTA()
  111.                 Exit Sub
  112.             Else
  113.                 ' ~~~ White List Check
  114.                 Call oDiskProtect.UpperFilterCheck("WhiteList")
  115.  
  116.                 If bWhiteList Then
  117.                     ' ~~~ Proceed with setting UpperFilters
  118.                     arrTempArray = Split(sUpperFilter, ",")
  119.                     For i = LBound(arrTempArray) to UBound(arrTempArray)
  120.                         ReDim Preserve arrUpperFilters(i)  
  121.                         arrUpperFilters(i) = arrTempArray(i+1)
  122.                     Next
  123.  
  124.                     ReDim Preserve arrUpperFilters(i-2)
  125.                     arrUpperFilters(i-2) = "Ewf"
  126.  
  127.                     ' ~~~ Writes to UpperFilters key
  128.                     oDiskProtect.WriteUpperFilterKey()
  129.  
  130.                     ' ~~~ Read and record UpperFilters key in SCT registry
  131.                     oDiskProtect.GetStashUpperFilterKey()
  132.  
  133.                     ' ~~~ Registry modified... prompt for Restart
  134.                     If MsgBox(document.all("resRebootMessage").innerHTML, vbYesNo + vbCritical, sTitle) = vbYes Then
  135.                         bProcessing = False
  136.                         call Self.Close
  137.                         oDiskProtect.Reboot
  138.                         TerminateHTA()
  139.                         Exit Sub
  140.                     Else
  141.                         bProcessing = False
  142.                         call Self.Close
  143.                         TerminateHTA()
  144.                         Exit Sub    
  145.                     End If
  146.                 Else
  147.                     Dim bPrompt
  148.                     bPrompt = False
  149.                     
  150.                     ' ~~~ Only warns of Gray UpperFilters if DEBUG                    
  151.                     If DEBUG then
  152.                         If MsgBox(vbCrlf & document.all("resUpperFilterGray1").innerHTML & vbCrlf & document.all("resUpperFilterGray2").innerHTML & vbCrlf & vbCrlf & document.all("resUpperFilterGray3").innerHTML, vbYesNo + vbInformation, sTitle) = vbYes Then
  153.                             bPrompt = True
  154.                         End If
  155.                     End If
  156.  
  157.                     If Not(DEBUG) or bPrompt Then   
  158.                         ' ~~~ Proceed with setting Gray UpperFilters
  159.                         arrTempArray = Split(sUpperFilter, ",")
  160.                         For i = LBound(arrTempArray) to UBound(arrTempArray)
  161.                              ReDim Preserve arrUpperFilters(i)  
  162.                             arrUpperFilters(i) = arrTempArray(i+1)
  163.                         Next
  164.  
  165.                         ReDim Preserve arrUpperFilters(i-2)
  166.                         arrUpperFilters(i-2) = "Ewf"
  167.     
  168.                         ' ~~~ Writes to UpperFilters key
  169.                         oDiskProtect.WriteUpperFilterKey()
  170.  
  171.                         ' ~~~ Read and record UpperFilters key in SCT registry
  172.                         oDiskProtect.GetStashUpperFilterKey()
  173.  
  174.                         ' ~~~ Registry modified... prompt for Restart
  175.                         If MsgBox(document.all("resRebootMessage").innerHTML, vbYesNo + vbCritical, sTitle) = vbYes Then
  176.                             bProcessing = False
  177.                             call Self.Close
  178.                             oDiskProtect.Reboot
  179.                             TerminateHTA()
  180.                             Exit Sub
  181.                         Else
  182.                             bProcessing = False
  183.                             call Self.Close
  184.                             TerminateHTA()
  185.                             Exit Sub    
  186.                         End If
  187.                     Else
  188.                         bProcessing = False
  189.                         call Self.Close
  190.                         TerminateHTA()
  191.                         Exit Sub        
  192.                     End If    
  193.                 End If
  194.             End If
  195.         
  196.         End If
  197.     On Error Goto 0
  198.     End If    
  199.  
  200.     If iInstallTime > iLastBootUpTime Then
  201.         If MsgBox(document.all("resRebootMessage").innerHTML, vbYesNo + vbCritical, sTitle) = vbYes Then
  202.             bProcessing = False
  203.             call Self.Close
  204.             oDiskProtect.Reboot
  205.             TerminateHTA()
  206.             Exit Sub
  207.         Else
  208.             bProcessing = False
  209.             call Self.Close
  210.             TerminateHTA()
  211.             Exit Sub
  212.         End If
  213.     End If
  214.  
  215.     If iOverlayTime > iLastBootUpTime Then
  216.         If MsgBox(document.all("resRebootMessageOV").innerHTML, vbYesNo + vbCritical, sTitle) = vbYes Then
  217.             bProcessing = False
  218.             call Self.Close
  219.             oDiskProtect.Reboot
  220.             TerminateHTA()
  221.             Exit Sub
  222.         Else
  223.             bProcessing = False
  224.             call Self.Close
  225.             TerminateHTA()
  226.             Exit Sub
  227.         End If
  228.     End If
  229.  
  230.     If Not(oDiskProtect.OverlayCreated) and oDiskProtect.CalcOVSize = 0 and oDiskProtect.ForceOverlaySize = 0 Then
  231.         If MsgBox (document.all("resNoOverlaySupport").innerHTML, vbYesNo + vbCritical, sTitle) = vbYes Then
  232.             Call oShell.Run("diskmgmt.msc",0,False)            
  233.         End If
  234.         bProcessing = False
  235.         call Self.Close
  236.         TerminateHTA()
  237.         Exit Sub
  238.     End If
  239.     
  240.     ' ~~~ If AU is enabled enable our WU
  241.  
  242.     Select Case RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions")
  243.         Case "4"
  244.             oDiskProtect.WindowsUpdateScript = True
  245.         Case "3"
  246.             oDiskProtect.WindowsUpdateScript = True
  247.         Case "2"
  248.             oDiskProtect.WindowsUpdateScript = True
  249.         Case "1"
  250.             oDiskProtect.WindowsUpdateScript = False
  251.     End Select
  252.  
  253. End Sub
  254.  
  255. ' *** 
  256. ' *** ------------------------------------------------------------------------------
  257. ' *** Name:            Load()
  258. ' *** ------------------------------------------------------------------------------
  259. ' *** Purpose:        This subroutine is executed before a wizard page is displayed
  260. ' *** ------------------------------------------------------------------------------
  261. ' *** 
  262. Sub Load()
  263.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  264.  
  265.     ' ~~~ Unhide the two drop downs
  266.     document.all("ddSchedule1").style.visibility = "visible"
  267.     document.all("ddSchedule2").style.visibility = "visible"
  268.  
  269.     ' ~~~ Call the sub to enable body 
  270.     Call BodyDisable(False) 
  271.     
  272.     ' ~~~ Call the sub to format the time
  273.     Call FormatScheduleTime()
  274.     
  275.     document.all("rActCommit").title = document.all("lblPendingAction2").innerHTML
  276.  
  277.     ' ~~~ Default pending changes action is undo
  278.     document.all("rActUndo").checked = True
  279.  
  280.     ' ~~~ Make radios reflect real status
  281.     If oDiskProtect.Enabled Then
  282.         document.all("radEnable").checked   = True
  283.         document.all("spStatus").innerHTML  = document.all("lblStatusEnabled").innerHTML
  284.         document.all("spEnable").innerHTML  = document.all("resRebootAction3").innerHTML
  285.         document.all("spDisable").innerHTML = document.all("resRebootAction4").innerHTML
  286.         Call DisableSection2(False)
  287.         Call DisableSection3(True)
  288.     Else
  289.         document.all("radDisable").checked   = True
  290.         document.all("spStatus").innerHTML  = document.all("lblStatusDisabled").innerHTML
  291.         document.all("spEnable").innerHTML  = document.all("resRebootAction1").innerHTML
  292.         document.all("spDisable").innerHTML = document.all("resRebootAction2").innerHTML
  293.         Call DisableSection2(True)
  294.         Call DisableSection3(True)
  295.     End If
  296.     
  297.     ' ~~~ Make radios reflect real pending changes state
  298.     Select Case oDiskProtect.BootCommand
  299.         Case "SET_LEVEL"
  300.             document.all("rActUndo").checked = True
  301.         Case "COMMIT"
  302.             document.all("rActCommit").checked = True
  303.         Case "NO_CMD"
  304.             document.all("rActRetain2").checked = True
  305.         Case "ENABLE"
  306.             document.all("radEnable").checked   = True
  307.             document.all("radDisable").checked   = False
  308.             document.all("rActUndo").checked = True
  309.         Case "DISABLE"
  310.             document.all("radEnable").checked   = False    
  311.             document.all("radDisable").checked   = True
  312.             document.all("rActUndo").checked = True
  313.     End Select
  314.  
  315.     If oDiskProtect.BootCommand = "NO_CMD" and Right(RegRead("HKLM\System\CurrentControlSet\Services\WDPOperations\parameters\Application"),7) = "restore" Then
  316.     document.all("rActRetain1").checked = True
  317.     End If
  318.  
  319.     ' ~~~ Default settings for windows update
  320.  
  321.     If oDiskProtect.WindowsUpdateScript Then
  322.         document.all("rDPWinUpEnabled").checked = True
  323.     Else
  324.         document.all("rDPWinUpDisabled").checked = True
  325.     End If
  326.  
  327.     If RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\AUOptions") = "" Then
  328.         document.all("rDPWinUpEnabled").checked = False
  329.         document.all("rDPWinUpDisabled").checked = False
  330.     End If
  331.  
  332.     document.all("ddSchedule1").value            = oDiskProtect.CriticalUpdateDay
  333.     document.all("ddSchedule2").value            = oDiskProtect.CriticalUpdateTime            
  334.     document.all("txtAntiVirusScript").value    = GetFileName(oDiskProtect.AVUpdateScript)
  335.     document.all("txtOtherScript").value        = GetFileName(oDiskProtect.OtherUpdateScript)
  336.     
  337.     If document.all("radEnable").checked Then 
  338.         document.all("radEnable").focus()
  339.     Else
  340.         document.all("radDisable").focus()
  341.     End If
  342. End Sub
  343.  
  344. ' *** 
  345. ' *** ------------------------------------------------------------------------------
  346. ' *** Name:            Validate()
  347. ' *** ------------------------------------------------------------------------------
  348. ' *** Purpose:        This function is executed before a wizard page is exited
  349. ' ***                 If this function returns false. The page does not exit.
  350. ' *** ------------------------------------------------------------------------------
  351. ' *** 
  352. Function Validate()
  353.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  354.     Validate = validateUpdates()
  355.     If Validate = True Then
  356.         Validate = IsHibernationenabled()
  357.     End If
  358.     If Validate = True Then
  359.         Validate = IsSystemBootSame()
  360.     End If
  361. End Function
  362.  
  363. ' *** 
  364. ' *** ------------------------------------------------------------------------------
  365. ' *** Name:            Action()
  366. ' *** ------------------------------------------------------------------------------
  367. ' *** Purpose:        This subroutine performs the actual functionality of the tool
  368. ' *** ------------------------------------------------------------------------------
  369. ' *** 
  370. Sub Action()
  371.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  372.     ToggleClose(True)
  373.     Dim bReboot, bWDPReBoot
  374.  
  375.     bProcessing = True
  376.  
  377.     ' ~~~ To change the cursor to wait icon
  378.     Call BodyDisable(True)
  379.     
  380.     ' ~~~ Set the default message
  381.     strActionMessage =  document.all("resActionNone").innerHTML
  382.     bReboot = False
  383.     bWDPReBoot = False
  384.  
  385.     ' ~~~ -------------------------
  386.     ' ~~~ If we are going to enable
  387.     ' ~~~ -------------------------
  388.     If Not(oDiskProtect.Enabled) and GetRadio("dpReboot")="Enable" Then
  389.         
  390.         strActionMessage = document.all("resBlank").innerHTML
  391.         oDiskProtect.Enable                
  392.  
  393.         ' ~~~ Check for Overlay
  394.         If oDiskProtect.OverlaySize() = 0 then
  395.             bReboot = False
  396.  
  397.             ' ~~~ Set message
  398.             strActionMessage =  document.all("resNoOverlay").innerHTML
  399.         Else
  400.             ' ~~~ Set message
  401.             strActionMessage = document.all("resActionEnable").innerHTML
  402.  
  403.             ' ~~~ Turn on critical updates
  404.             If document.all("rDPWinUpEnabled").checked = True Then
  405.                 oDiskProtect.WindowsUpdateScript = True
  406.             Else
  407.                 oDiskProtect.WindowsUpdateScript = False
  408.             End If
  409.             oDiskProtect.AVUpdateScript      = AVscriptPath & document.all("txtAntiVirusScript").value
  410.             oDiskProtect.OtherUpdateScript   = OtherscriptPath & document.all("txtOtherScript").value
  411.             oDiskProtect.CriticalUpdateDay   = document.all("ddSchedule1").value
  412.             oDiskProtect.CriticalUpdateTime  = document.all("ddSchedule2").value
  413.             Call oDiskProtect.EnableCriticalUpdates()
  414.             bWDPReBoot = Showmodaldialog("WDPOn.hta","","dialogWidth:30;dialogHeight:18;Center:Yes;help:No;Resizable:No;")
  415.             bProcessing = False
  416.             call Self.Close()
  417.             If bWDPReBoot Then
  418.                 oDiskProtect.Reboot
  419.                 TerminateHTA()
  420.             End If
  421.             Exit Sub
  422.         End IF
  423.     End If
  424.  
  425.     ' ~~~ --------------------------
  426.     ' ~~~ If we are going to disable
  427.     ' ~~~ --------------------------
  428.     If oDiskProtect.Enabled and GetRadio("dpReboot")="Disable" Then
  429.         strActionMessage = document.all("resActionDisable").innerHTML
  430.         bReboot = True
  431.         oDiskProtect.Disable        
  432.  
  433.         ' ~~~ Turn off critical updates
  434.         Call oDiskProtect.DisableCriticalUpdates()
  435.     End If
  436.  
  437.     If oDiskProtect.BootCommand = "ENABLE" and GetRadio("dpReboot")="Disable" Then
  438.         strActionMessage = document.all("resActionAlreadyOff").innerHTML
  439.         bReboot = False
  440.         oDiskProtect.Disable        
  441.  
  442.         ' ~~~ Turn off critical updates
  443.         Call oDiskProtect.DisableCriticalUpdates()
  444.     End If
  445.  
  446.     ' ~~~ -----------------------------------------
  447.     ' ~~~ If enabled and leaving on, process action
  448.     ' ~~~ -----------------------------------------
  449.     If oDiskProtect.Enabled and GetRadio("dpReboot")="Enable" Then
  450.         Select Case GetRadio("dpAction")
  451.             Case "Undo"
  452.                 If oDiskProtect.BootCommand <> "SET_LEVEL" Then
  453.                     strActionMessage = document.all("resPendingAction1").innerHTML
  454.                     bReboot = False
  455.                     oDiskProtect.UndoChanges
  456.                 End If
  457.             Case "Commit"
  458.                 If oDiskProtect.BootCommand <> "COMMIT" Then
  459.                     strActionMessage = document.all("resPendingAction2").innerHTML
  460.                     bReboot = False
  461.                     oDiskProtect.Commit
  462.                     If document.all("rDPWinUpEnabled").checked = True Then
  463.                         oDiskProtect.WindowsUpdateScript = True
  464.                     Else
  465.                         oDiskProtect.WindowsUpdateScript = False
  466.                     End If
  467.                     oDiskProtect.AVUpdateScript      = AVscriptPath & document.all("txtAntiVirusScript").value
  468.                     oDiskProtect.OtherUpdateScript   = OtherscriptPath & document.all("txtOtherScript").value
  469.                     oDiskProtect.CriticalUpdateDay   = document.all("ddSchedule1").value
  470.                     oDiskProtect.CriticalUpdateTime  = document.all("ddSchedule2").value
  471.                     Call oDiskProtect.EnableCriticalUpdates()
  472.                 End If
  473.             Case "Retain1"
  474.                 strActionMessage = document.all("resPendingAction3").innerHTML
  475.                 bReboot = False
  476.                 oDiskProtect.RetainChanges(True)    
  477.             Case "Retain2"
  478.                 strActionMessage = document.all("resPendingAction4").innerHTML
  479.                 bReboot = False
  480.                 oDiskProtect.RetainChanges(False)
  481.         End Select            
  482.     End If            
  483.  
  484.     ' ~~~ To change the cursor to wait icon
  485.     Call BodyDisable(False)
  486.  
  487.     ' ~~~ --------------------------------------
  488.     ' ~~~ Display restart message if appropriate
  489.     ' ~~~ --------------------------------------
  490.     If bReboot Then
  491.         If MsgBox(strActionMessage & document.all("resRebootMessage2").innerHTML, vbYesNo + vbInformation, sTitle) = vbYes Then
  492.             bProcessing = False
  493.             call Self.Close
  494.             oDiskProtect.Reboot
  495.             Exit Sub
  496.         End If
  497.     Else 
  498.         MsgBox strActionMessage,vbOKOnly+vbInformation,sTitle
  499.     End If
  500.  
  501.     bProcessing = False
  502. End Sub
  503.  
  504. ' *** 
  505. ' *** ------------------------------------------------------------------------------
  506. ' *** Name:            DisableSection2(bDisabled)
  507. ' *** ------------------------------------------------------------------------------
  508. ' *** Purpose:        Enables or disables sections of the screen
  509. ' *** ------------------------------------------------------------------------------
  510. ' *** 
  511. Sub DisableSection2(bDisabled)
  512.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  513.     document.all("rActUndo").Disabled         = bDisabled
  514.     document.all("rActCommit").Disabled       = bDisabled
  515.     document.all("rActRetain1").Disabled      = bDisabled
  516.     document.all("rActRetain2").Disabled      = bDisabled
  517.  
  518.     ' ~~~ Change the class
  519.     If bDisabled Then
  520.         document.all("tdPendingChange").className = "groupentrydisabled"
  521.     Else
  522.         document.all("tdPendingChange").className = "groupentry"
  523.     End If
  524. End Sub
  525.  
  526. ' *** 
  527. ' *** ------------------------------------------------------------------------------
  528. ' *** Name:            DisableSection3(bDisabled)
  529. ' *** ------------------------------------------------------------------------------
  530. ' *** Purpose:        Enables or disables sections of the screen
  531. ' *** ------------------------------------------------------------------------------
  532. ' *** 
  533. Sub DisableSection3(bDisabled)
  534.     ddSchedule1.Disabled        = bDisabled
  535.     ddSchedule2.Disabled        = bDisabled
  536.     rDPWinUpEnabled.Disabled    = bDisabled
  537.     rDPWinUpDisabled.Disabled    = bDisabled
  538.     txtAntiVirusScript.Disabled    = bDisabled
  539.     btnAntiVirusScript.Disabled    = bDisabled
  540.     txtOtherScript.Disabled        = bDisabled
  541.     btnOtherScript.Disabled        = bDisabled
  542.  
  543.     ' ~~~ Change the class
  544.     If bDisabled Then
  545.         SetGreyHoverMessage()
  546.     End If
  547. End Sub
  548.  
  549. ' *** 
  550. ' *** ------------------------------------------------------------------------------
  551. ' *** Name:            EnableDisableClick()
  552. ' *** ------------------------------------------------------------------------------
  553. ' *** Purpose:        Called when the disk protection status radio button is clicked
  554. ' *** ------------------------------------------------------------------------------
  555. ' *** 
  556. Sub EnableDisableClick()
  557.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  558.     If document.all("spStatus").innerHTML = document.all("lblStatusEnabled").innerHTML Then
  559.         If GetRadio("dpReboot")="Disable" Then
  560.             document.all("rActUndo").checked = True
  561.             Call DisableSection2(True)
  562.             Call DisableSection3(True)
  563.         Else
  564.             Call DisableSection2(False)
  565.             If GetRadio("dpAction")="Commit" Then
  566.                 Call DisableSection3(False)
  567.             Else
  568.                 Call DisableSection3(True)
  569.             End If
  570.         End If
  571.     Else
  572.         If GetRadio("dpReboot")="Enable" Then
  573.             Call DisableSection3(False)
  574.             Call CheckVirusSoftware
  575.         Else
  576.             Call DisableSection3(True)
  577.         End If            
  578.     End If
  579. End Sub
  580.  
  581. ' *** 
  582. ' *** ------------------------------------------------------------------------------
  583. ' *** Name:            BrowseForFileAV(txtControl)
  584. ' *** ------------------------------------------------------------------------------
  585. ' *** Purpose:        Called when the Browse for Anti virus is clicked
  586. ' *** ------------------------------------------------------------------------------
  587. ' *** 
  588. Sub BrowseForFileAV(txtControl)
  589.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  590.     Dim oDialog
  591.     Dim intResult
  592.     ' ~~~ Create common dialog object and set options
  593.     Set oDialog = CreateObject("UserAccounts.CommonDialog")
  594.     oDialog.Filter = "Script Files (*.vbs; *.js; *.wsf)|*.vbs;*.js;*.wsf|Batch Files (*.cmd; *.bat)|*.cmd;*.bat|All Files (*.*)|*.*"
  595.     oDialog.FilterIndex = 1
  596.     oDialog.InitialDir  = ".\scripts\update"
  597.  
  598.     ' ~~~ Show dialog
  599.     intResult = oDialog.ShowOpen
  600.     if intResult <> 0 Then
  601.         AVscriptPath = GetFilePath(oDialog.FileName)
  602.         ' ~~~ Populate text field
  603.         document.all(txtControl).value = GetFileName(oDialog.FileName)
  604.     End If
  605. End Sub
  606.  
  607. ' *** 
  608. ' *** ------------------------------------------------------------------------------
  609. ' *** Name:            BrowseForFileOther(txtControl)
  610. ' *** ------------------------------------------------------------------------------
  611. ' *** Purpose:        Called when the Browse for Other updates is clicked
  612. ' *** ------------------------------------------------------------------------------
  613. ' *** 
  614. Sub BrowseForFileOther(txtControl)
  615.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  616.     Dim oDialog
  617.     Dim intResult
  618.     ' ~~~ Create common dialog object and set options
  619.     Set oDialog            = CreateObject("UserAccounts.CommonDialog")
  620.     oDialog.Filter        = "Script Files (*.vbs; *.js; *.wsf)|*.vbs;*.js;*.wsf|Batch Files (*.cmd; *.bat)|*.cmd;*.bat|All Files (*.*)|*.*"
  621.     oDialog.FilterIndex = 1
  622.     oDialog.InitialDir  = ".\scripts\update"
  623.  
  624.     ' ~~~ Show dialog
  625.     intResult = oDialog.ShowOpen
  626.     if intResult <> 0 Then
  627.         OtherscriptPath = GetFilePath(oDialog.FileName)
  628.         ' ~~~ Populate text field
  629.         document.all(txtControl).value = GetFileName(oDialog.FileName)
  630.     End If
  631. End Sub
  632.  
  633. ' *** 
  634. ' *** ------------------------------------------------------------------------------
  635. ' *** Name:            GetFileName(file)
  636. ' *** ------------------------------------------------------------------------------
  637. ' *** Purpose:        Returns the file name from the full filename with path
  638. ' *** ------------------------------------------------------------------------------
  639. ' *** 
  640. private Function GetFileName(file)
  641.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  642.     Dim arrFile
  643.     Dim iupper
  644.     if file <> "" Then
  645.         arrFile = Split(file , "\") 
  646.         iupper = UBound(arrFile) 
  647.         GetFileName = arrFile(iupper)
  648.     End If
  649. End Function
  650.  
  651. ' *** 
  652. ' *** ------------------------------------------------------------------------------
  653. ' *** Name:            GetFilePath(file)
  654. ' *** ------------------------------------------------------------------------------
  655. ' *** Purpose:        Returns the filepath from the full filename with path
  656. ' *** ------------------------------------------------------------------------------
  657. ' *** 
  658.  
  659. private Function GetFilePath(file)
  660.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  661.     Dim arrFile
  662.     Dim FileName
  663.     Dim path,iupper,total,length
  664.  
  665.     if file <> "" Then
  666.         arrFile = Split(file , "\") 
  667.         iupper = UBound(arrFile) 
  668.         FileName = arrFile(iupper)
  669.         total = len(file)
  670.         length = len(Filename)
  671.         GetFilePath = left(file,total-length)
  672.     End If
  673. End Function
  674.  
  675. ' *** 
  676. ' *** ------------------------------------------------------------------------------
  677. ' *** Name:            CheckVirusSoftware
  678. ' *** ------------------------------------------------------------------------------
  679. ' *** Purpose:        validates the update scripts
  680. ' *** ------------------------------------------------------------------------------
  681. ' *** 
  682. private Function CheckVirusSoftware
  683.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  684.  
  685.     Dim sVersion, sRegpath, sScriptname, sRegVersion, sProductName, bAVInstalled
  686.     
  687.     Dim oXml, avXml, oProduct, oProdChildNode 
  688.     
  689.     bAVInstalled = False
  690.         
  691.     If document.all("txtAntiVirusScript").value = "" then
  692.     
  693.     ' ~~~ Checks for different software can be done in many ways... currently done by looking for service
  694.     ' ~~~ Might modify after other versions are investigated.
  695.     
  696.         AVscriptPath = GetRootFolder & "\scripts\update\"
  697.  
  698.         avXml = GetRootFolder & "\xml\AntiVirusUpdates.xml"
  699.         
  700.         Set oXml = CreateObject("MSXML2.DomDocument")
  701.         
  702.         Call oXml.Load(avXml)
  703.         
  704.         If oXml.parseError.errorCode = 0 Then
  705.             ' ~~~ Loop through each of the AV products 
  706.             For Each oProduct in oXml.getElementsByTagName("Product")
  707.                 ' ~~~ Get the values of each product
  708.                 For Each oProdChildNode in oProduct.ChildNodes
  709.                     Select Case oProdChildNode.NodeName 
  710.                         Case "Name"
  711.                             sProductName = oProdChildNode.Text
  712.                         Case "Version"
  713.                             sVersion = oProdChildNode.Text
  714.                         Case "RegKey"
  715.                             sRegpath = oProdChildNode.Text
  716.                         Case "UpdateScriptname"
  717.                             sScriptName = oProdChildNode.Text
  718.                     End Select
  719.                 Next
  720.                 
  721.                 ' ~~~ Get the AV version from registry
  722.                 sRegVersion = Left(RegRead(sRegpath),4)
  723.                 
  724.                 ' ~~~ If the registry exists for the product then proceed
  725.                 If sRegVersion <> "" Then
  726.                     ' ~~~ Compare the versions in registry and XML file  
  727.                     If Instr(sRegVersion, sVersion) = 1 Then
  728.                         If Msgbox(sProductName & " " & resAVSoftwareDetected.innerHTML & vbCrlf & resSpecifyAVScript.innerHTML,vbYesNo + vbCritical, sTitle) = vbYes Then
  729.                             document.all("txtAntiVirusScript").value = GetFileName(AVscriptPath & "\" & sScriptName)
  730.                         End If
  731.                     End If
  732.                     bAVInstalled = True
  733.                 End If
  734.             Next
  735.         End If
  736.  
  737.         If bAVInstalled = False then
  738.             AVscriptPath = ""
  739.             Msgbox document.all("resNoAVSoftwareDetected").innerHTML & vbCrlf & document.all("resNoAVSoftwareAction").innerHTML, vbOkOnly + vbCritical, sTitle
  740.         End If
  741.     End If
  742. End Function
  743.  
  744. ' *** 
  745. ' *** ------------------------------------------------------------------------------
  746. ' *** Name:            validateUpdates()
  747. ' *** ------------------------------------------------------------------------------
  748. ' *** Purpose:        validates the update scripts
  749. ' *** ------------------------------------------------------------------------------
  750. ' *** 
  751. private Function validateUpdates()
  752.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  753.     
  754.     validateUpdates = true
  755.     If document.all("txtAntiVirusScript").value = "" Then
  756.         AVscriptPath = ""
  757.     Else
  758.         If RegRead(TOOLKITKEY & "AVUpdateScript") <> "" and AVscriptPath = "" then AVscriptPath = GetFilePath(RegRead(TOOLKITKEY & "AVUpdateScript"))
  759.         If (oFso.FileExists(AVscriptPath & document.all("txtAntiVirusScript").value) <> true) Then
  760.             If (oFso.FileExists(document.all("txtAntiVirusScript").value) <> true) Then
  761.                 validateUpdates = false
  762.                 MsgBox document.all("resValidAntivirusScript").innerHTML,16, sTitle
  763.                 document.all("txtAntiVirusScript").value = ""
  764.                 Exit Function
  765.             Else 
  766.                 validateUpdates = true
  767.                 AVscriptPath = ""
  768.             End If
  769.         End If
  770.     End If 
  771.     If document.all("txtOtherScript").value = "" Then
  772.         OtherscriptPath = ""
  773.         Exit Function
  774.     Else 
  775.         If RegRead(TOOLKITKEY & "OtherUpdateScript") <> "" and OtherscriptPath = "" then OtherscriptPath = GetFilePath(RegRead(TOOLKITKEY & "OtherUpdateScript"))
  776.         If (oFso.FileExists(OtherscriptPath & document.all("txtOtherScript").value) <> true) Then
  777.             If (oFso.FileExists(document.all("txtOtherScript").value) <> true) Then
  778.                 validateUpdates = false
  779.                 MsgBox document.all("resValidOtherScript").innerHTML,16, sTitle
  780.                 document.all("txtOtherScript").value = ""
  781.                 Exit Function
  782.             Else
  783.                 validateUpdates = true
  784.                 OtherscriptPath = ""
  785.             End If
  786.         End If
  787.     End If 
  788. End Function
  789.  
  790. ' *** 
  791. ' *** ------------------------------------------------------------------------------
  792. ' *** Name:            TextClick(sId)
  793. ' *** ------------------------------------------------------------------------------
  794. ' *** Purpose:        Enables or Disables the Corresponding option next to the 
  795. ' ***                text that is being clicked
  796. ' *** ------------------------------------------------------------------------------
  797. ' *** 
  798. Sub TextClick(sId)
  799.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  800.     Select Case sId
  801.         Case "spEnable"
  802.             document.all("radEnable").checked = True
  803.             EnableDisableClick()
  804.         Case "spDisable"
  805.             document.all("radDisable").checked = True
  806.             EnableDisableClick()
  807.         Case "spActUndo"
  808.             If document.all("tdPendingChange").classname = "groupentry" Then
  809.                 document.all("rActUndo").checked = True
  810.                 EnableDisableClick()
  811.             End If
  812.         Case "spActCommit"
  813.             If document.all("tdPendingChange").classname = "groupentry" Then
  814.                 document.all("rActCommit").checked = True
  815.                 EnableDisableClick()
  816.             End If
  817.         Case "spActRetain1"
  818.             If document.all("tdPendingChange").classname = "groupentry" Then
  819.                 document.all("rActRetain1").checked = True
  820.                 EnableDisableClick()
  821.             End If
  822.         Case "spActRetain2"
  823.             If document.all("tdPendingChange").classname = "groupentry" Then
  824.                 document.all("rActRetain2").checked = True
  825.                 EnableDisableClick()
  826.             End If
  827.         Case "spWinUPEnabled"
  828.             If Not document.all("rDPWinUpEnabled").disabled Then
  829.                 document.all("rDPWinUpEnabled").checked = True
  830.             End If
  831.         Case "spWinUPDisabled"
  832.             If Not document.all("rDPWinUpDisabled").disabled Then
  833.                 document.all("rDPWinUpDisabled").checked = True
  834.             End If
  835.     End Select
  836. End Sub
  837.  
  838. ' *** 
  839. ' *** ------------------------------------------------------------------------------
  840. ' *** Name:            TextDisplay(sOptId)
  841. ' *** ------------------------------------------------------------------------------
  842. ' *** Purpose:        Sets the text to be displayed in the pop-up when mouse is 
  843. ' ***                hovered over controls.
  844. ' *** ------------------------------------------------------------------------------
  845. ' *** 
  846. Sub TextDisplay(sOptId)
  847.  
  848.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  849.     Select Case sOptId
  850.         Case "spEnable"
  851.             ' ~~~ Check the text displayed next to the radio
  852.             If document.all("spEnable").innerHTML = document.all("resRebootAction1").innerHTML Then
  853.                 document.all("spEnable").title =  document.all("lblRebootAction1").innerHTML
  854.             Else
  855.                 document.all("spEnable").title = document.all("lblRebootAction3").innerHTML
  856.             End If
  857.         Case "spDisable"
  858.             If document.all("spDisable").innerHTML = document.all("resRebootAction2").innerHTML Then
  859.                 document.all("spDisable").title = document.all("lblRebootAction2").innerHTML
  860.             Else
  861.                 document.all("spDisable").title = document.all("lblRebootAction4").innerHTML
  862.             End If
  863.         Case "tdPendingChange"
  864.             If document.all("tdPendingChange").classname = "groupentry" Then
  865.                 document.all("rActUndo").title = document.all("lblPendingAction1").innerHTML
  866.                 document.all("rActCommit").title = document.all("lblPendingAction2").innerHTML
  867.                 document.all("rActRetain1").title = document.all("lblPendingAction3").innerHTML
  868.                 document.all("rActRetain2").title = document.all("lblPendingAction4").innerHTML
  869.                 document.all("spActUndo").title = document.all("lblPendingAction1").innerHTML
  870.                 document.all("spActCommit").title = document.all("lblPendingAction2").innerHTML
  871.                 document.all("spActRetain1").title = document.all("lblPendingAction3").innerHTML
  872.                 document.all("spActRetain2").title = document.all("lblPendingAction4").innerHTML
  873.             Else
  874.                 document.all("rActUndo").title = document.all("lblPendingAction1grey").innerHTML
  875.                 document.all("rActCommit").title = document.all("lblPendingAction2grey").innerHTML
  876.                 document.all("rActRetain1").title = document.all("lblPendingAction3grey").innerHTML
  877.                 document.all("rActRetain2").title = document.all("lblPendingAction4grey").innerHTML
  878.                 document.all("spActUndo").title = document.all("lblPendingAction1grey").innerHTML
  879.                 document.all("spActCommit").title = document.all("lblPendingAction2grey").innerHTML
  880.                 document.all("spActRetain1").title = document.all("lblPendingAction3grey").innerHTML
  881.                 document.all("spActRetain2").title = document.all("lblPendingAction4grey").innerHTML
  882.             End If
  883.         Case "txtAntiVirusScript" , "btnAntiVirusScript"
  884.             If Not document.all("txtAntiVirusScript").disabled Then
  885.                 document.all("txtAntiVirusScript").title = document.all("lblAVScriptTxt").innerHTML
  886.             End If
  887.             If Not document.all("btnAntiVirusScript").disabled Then 
  888.                 document.all("btnAntiVirusScript").title = document.all("lblAVScriptBtn").innerHTML
  889.             End If
  890.             
  891.         Case "txtOtherScript" , "btnOtherScript"
  892.             If Not document.all("txtOtherScript").disabled Then
  893.                 document.all("txtOtherScript").title = document.all("lblUpdateScriptTxt").innerHTML
  894.             End If            
  895.             If Not document.all("btnOtherScript").disabled Then
  896.                 document.all("btnOtherScript").title = document.all("lblUpdateScriptBtn").innerHTML
  897.             End If
  898.             
  899.         Case "spWinUPEnabled"
  900.             If Not document.all("rDPWinUpEnabled").disabled Then
  901.                 document.all("spWinUPEnabled").title = document.all("lblWinUPEnabled").innerHTML
  902.             End If
  903.         Case "spWinUPDisabled"
  904.             If Not document.all("rDPWinUpDisabled").disabled Then
  905.                 document.all("spWinUPDisabled").title = document.all("lblWinUPDisabled").innerHTML
  906.             End If
  907.             
  908.     End Select
  909. End Sub
  910.  
  911. ' *** 
  912. ' *** ------------------------------------------------------------------------------
  913. ' *** Name:            IsSystemBootSame()
  914. ' *** ------------------------------------------------------------------------------
  915. ' *** Purpose:        Returns True if System and Boot Partitions are the same
  916. ' *** ------------------------------------------------------------------------------
  917. ' *** 
  918. Private Function IsSystemBootSame()
  919.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  920.     IsSystemBootSame = True
  921.     If  (document.all("radEnable").checked = True) and (oDiskProtect.SystemBootSame() = False) and Not(oDiskProtect.Enabled) Then
  922.         msgbox document.all("resSystemBootNotSame").innerHTML,vbOKOnly + vbInformation, sTitle
  923.         IsSystemBootSame = True
  924.     End If 
  925. End Function
  926.  
  927. ' *** 
  928. ' *** ------------------------------------------------------------------------------
  929. ' *** Name:            IsHibernationenabled()
  930. ' *** ------------------------------------------------------------------------------
  931. ' *** Purpose:        Returns true if hibernation is enabled else returns false
  932. ' *** ------------------------------------------------------------------------------
  933. ' *** 
  934. Private Function IsHibernationenabled()
  935.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  936.     IsHibernationenabled = True
  937.     If  (document.all("radEnable").checked = True) and (oDiskProtect.GetHibernation() = True) and Not(oDiskProtect.Enabled) Then
  938.         If (msgbox(document.all("resHibernationWDPWarning").innerHTML,vbYesNo+vbInformation, sTitle) <> vbYes) Then
  939.             IsHibernationenabled = False
  940.         End If                    
  941.     End If 
  942. End Function
  943.  
  944. ' *** 
  945. ' *** ------------------------------------------------------------------------------
  946. ' *** Name:         ToggleClose(bToggle)
  947. ' *** ------------------------------------------------------------------------------
  948. ' *** Purpose:      This subroutine is executed to toggle the Finish button.
  949. ' *** ------------------------------------------------------------------------------
  950. ' *** 
  951.  
  952. Sub ToggleClose(bToggle)
  953.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  954.         If bToggle = True Then
  955.             btnFinish.disabled = True
  956.             btnFinish.style.cursor = "auto"
  957.         Else
  958.             btnFinish.disabled = False
  959.             btnFinish.style.cursor = "hand"
  960.         End If
  961. End Sub
  962.  
  963. ' *** 
  964. ' *** ------------------------------------------------------------------------------
  965. ' *** Name:            HTAKeyDown()
  966. ' *** ------------------------------------------------------------------------------
  967. ' *** Purpose:        This is the handler function for tool specific key controls
  968. ' *** ------------------------------------------------------------------------------
  969. ' *** 
  970. Sub HTAKeyDown()
  971.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0    
  972. End Sub
  973.  
  974. ' *** 
  975. ' *** ------------------------------------------------------------------------------
  976. ' *** Name:            WDPRestart()
  977. ' *** ------------------------------------------------------------------------------
  978. ' *** Purpose:        This is called from the WDPOn.HTA. This functions restarts
  979. ' ***                the system.
  980. ' *** ------------------------------------------------------------------------------
  981. ' *** 
  982. Sub WDPRestart()
  983.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0    
  984.     ' ~~~ To restart the system if yes is clicked in the WDPOn.hta
  985.     window.returnvalue = True
  986.     Self.Close()
  987. End Sub
  988.  
  989. ' *** 
  990. ' *** ------------------------------------------------------------------------------
  991. ' *** Name:            SetGreyHoverMessage()
  992. ' *** ------------------------------------------------------------------------------
  993. ' *** Purpose:        This method sets the disabled hover messages for the
  994. ' ***                controls.
  995. ' *** ------------------------------------------------------------------------------
  996. ' *** 
  997. Sub SetGreyHoverMessage()
  998.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0    
  999.     ' ~~~ Set disabled hover message for the controls
  1000.     document.all("txtAntiVirusScript").title = document.all("lblAVScriptgrey").innerHTML
  1001.     document.all("btnAntiVirusScript").title = document.all("lblAVScriptgrey").innerHTML
  1002.     document.all("txtOtherScript").title = document.all("lblUpdateScriptgrey").innerHTML
  1003.     document.all("btnOtherScript").title = document.all("lblUpdateScriptgrey").innerHTML
  1004.     document.all("spWinUPEnabled").title = document.all("lblWinUPEnabledgrey").innerHTML
  1005.     document.all("spWinUPDisabled").title = document.all("lblWinUPDisabledgrey").innerHTML
  1006. End Sub
  1007.  
  1008. ' *** 
  1009. ' *** ------------------------------------------------------------------------------
  1010. ' *** Name:            FormatScheduleTime()
  1011. ' *** ------------------------------------------------------------------------------
  1012. ' *** Purpose:        This is method executed to format the time according 
  1013. ' ***                to regional settings.
  1014. ' *** ------------------------------------------------------------------------------
  1015. ' *** 
  1016. Sub FormatScheduleTime()
  1017.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0    
  1018.     
  1019.     Dim colOptions, oOption, sTime, iPos, sTimeSeparator 
  1020.     
  1021.     CONST vbLongTime = 3
  1022.     
  1023.     sTimeSeparator = ":"
  1024.     
  1025.     Set colOptions = ddSchedule2.Options
  1026.     
  1027.     For Each oOption in colOptions 
  1028.         sTime = FormatDateTime(oOption.Text,vbLongTime)
  1029.         If len(sTime) > 8 and InStr(1, sTime, sTimeSeparator) > 0 Then    
  1030.             If sTimeSeparator <> " " Then
  1031.                 iPos = InStrRev(sTime, sTimeSeparator)
  1032.             Else
  1033.                 iPos = InStrRev(sTime, sTimeSeparator)
  1034.                 iPos = InStrRev(sTime, sTimeSeparator, iPos-1)
  1035.             End If
  1036.             sTime =  Left(sTime, iPos-1) & Mid(sTime, iPos+len(sTimeSeparator)+2 ) 
  1037.         Else
  1038.             If len(sTime) <= 8 and InStr(1, sTime, sTimeSeparator) > 0 Then    
  1039.                 iPos = InStrRev(sTime, sTimeSeparator)
  1040.                 sTime =  Left(sTime, iPos-1) 
  1041.             End If
  1042.         End If
  1043.         
  1044.         ' ~~~ Set the formatted time if proper
  1045.         If len(sTime) <= 12 then oOption.Text = sTime
  1046.     Next 
  1047. End Sub
  1048.  
  1049. ' ***
  1050. ' *** ------------------------------------------------------------------------------
  1051. ' *** Name:            HTAUnLoad()
  1052. ' *** ------------------------------------------------------------------------------
  1053. ' *** Purpose:        This method unloads all the objects 
  1054. ' ***            created within the scope of the HTA
  1055. ' *** ------------------------------------------------------------------------------
  1056. ' ***
  1057. Sub HTAUnLoad()
  1058.     If NOT DEBUG Then On Error Resume Next Else On Error Goto 0
  1059.     
  1060.     Set oDiskProtect = Nothing
  1061.     Set oLog      = Nothing 
  1062.     
  1063. End Sub
  1064.