home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 221 - Disc 1 / DPCS0706.ISO / In The Mag / Programming Expert / HomeRotator.exe / HomeRotator / Uninstall.vbs < prev   
Encoding:
Text File  |  2006-03-22  |  1.0 KB  |  38 lines

  1. button=Msgbox ("You are about to uninstall Home Page Rotator - click OK to continue or Cancel to abort",1)
  2.  
  3. if button <> 1 then Stop
  4.  
  5. set fso=CreateObject("Scripting.FileSystemObject")
  6. Set WshShell = WScript.CreateObject("WScript.Shell")
  7.  
  8. 'Get folder names
  9. Set WshSysEnv = WshShell.Environment("PROCESS")
  10. ProgFolder=WshSysEnv("ProgramFiles")
  11. ProgFolder =ProgFolder & "\HomePageRotator"
  12.  
  13. Set WshSysEnv = WshShell.Environment("PROCESS")
  14. Rotatefile=WshSysEnv("SystemRoot") & "\System32\rotate.vbs"
  15.  
  16. 'delete folder
  17. if fso.folderexists(ProgFolder) then
  18.  fso.deletefolder "C:\Program Files\HomePageRotator",true 
  19. end if
  20.  
  21. 'Delete existing task if any
  22. cmdline ="schtasks /delete /tn ""Home Page Rotate"" /f"
  23. set sched=wshShell.exec(cmdline)
  24. do while sched.status=0
  25.  wscript.sleep 100
  26. loop
  27.  
  28. 'delete file
  29. if fso.FileExists(Rotatefile) then
  30.  fso.DeleteFile(Rotatefile)
  31. end if
  32.  
  33. 'undo redistry
  34. WshShell.RegDelete "HKCU\Software\Microsoft\Internet Explorer\MenuExt\Add page to home page rotation\"
  35.  
  36.  
  37.  
  38. Msgbox "uninstall complete"