home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / free_security / msshared / Shared_Computer_Toolkit_ENU.msi / FileBin021 < prev    next >
Encoding:
Text (UTF-16)  |  2005-09-02  |  5.3 KB  |  62 lines

  1. ' ***
  2. ' *** ------------------------------------------------------------------------------
  3. ' *** Filename:        SCTPostUninstall.vbs
  4. ' *** ------------------------------------------------------------------------------
  5. ' *** Description:    Post-Uninistall process to clean up Computer
  6. ' *** ------------------------------------------------------------------------------
  7. ' *** Version:        1.0
  8. ' *** Notes:        
  9. ' *** ------------------------------------------------------------------------------
  10. ' *** Copyright (C) Microsoft Corporation 2005, All Rights Reserved
  11. ' *** ------------------------------------------------------------------------------
  12. ' *** 
  13.  
  14. ' ~~~ 
  15. ' ~~~ Force variables to be declared 
  16. ' ~~~ 
  17. Option Explicit
  18.  
  19. ' ~~~ Turn on error handling
  20. On Error Resume Next
  21.  
  22. ' ~~~ 
  23. ' ~~~ Declare global variables 
  24. ' ~~~ 
  25. Dim oShell,sAppDir, sCMD
  26. Dim oWMIService, oOS, colOperatingSystems, iUninstallTime, iLastBootUpTime, sComputer
  27.  
  28. ' ~~~ ------------------------------------------------------------------------------
  29. ' ~~~ Create objects
  30. ' ~~~ ------------------------------------------------------------------------------
  31. Set oShell = CreateObject("WScript.Shell")
  32. sAppDir = oshell.RegRead("HKLM\Software\Microsoft\SharedComputerToolkitUninstall\TargetDir")
  33.  
  34. ' ~~~ ------------------------------------------------------------------------------
  35. ' ~~~ Clean!
  36. ' ~~~ ------------------------------------------------------------------------------
  37.  
  38.     ' ~~~ Check reboot key before trying to run tool
  39.  
  40.     Set oWMIService = GetObject _
  41.         ("winmgmts:\\.\root\cimv2")
  42.     Set colOperatingSystems = oWMIService.ExecQuery _
  43.         ("Select * from Win32_OperatingSystem")
  44.     For Each oOS in colOperatingSystems
  45.         iLastBootUpTime = oOS.LastBootUpTime
  46.     Next
  47.  
  48.     iUninstallTime = oShell.RegRead("HKLM\Software\Microsoft\SharedComputerToolkitUninstall\SCTUninstallTime")
  49.  
  50.     If iUninstallTime < iLastBootUpTime Then
  51.         Call oShell.Run("CMD /C %WinDir%\etprep.exe -delete", 0, True)
  52.         Call oShell.Run("CMD /C DEL %WinDir%\etprep.exe", 0, True)
  53.         Call oShell.Run("CMD /C DEL %WinDir%\ewfdll.dll", 0, True)
  54.         Call oShell.Run("CMD /C DEL %WinDir%\System32\Shared_Computer_Toolkit.log", 0, True)
  55.         Call oShell.Run("CMD /C RD /S /Q " & """" & sAppDir & """", 0, True)
  56.         Call oShell.Run("REG DELETE HKLM\Software\Microsoft\SharedComputerToolkitUninstall /f", 0, True)
  57.         
  58.         Call oShell.Run("REG DELETE HKLM\Software\Microsoft\Windows\CurrentVersion\Run /f /v SCTPostUninstall1", 0, True)
  59.  
  60.         Call oShell.Run("REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce /f /v SCTPostUninstall2 /t REG_EXPAND_SZ /d ""cmd /c del %WinDir%\SCTPostUninstall.VBS""", 0, True)
  61.     End If
  62.