home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2004 February / CD Rom Data Şubat 2004.iso / Media / Internet / host-mon.exe / Examples / Scripts / RegRead.vbs < prev   
Encoding:
Text File  |  2002-10-22  |  1.3 KB  |  40 lines

  1. '-----------------------------------------------------------------------------
  2. 'File    : RegRead.VBS
  3. 'Purpose : Sample script test for Advanced Host Monitor
  4. 'Comment : Reads registry data. Sets test's status to "Bad" when some 
  5. '          application (or a user) changes address to a web page that Internet 
  6. '          Explorer uses as home page
  7. 'Req     : Test's option "Translate macros" must be enabled
  8. 'Language: VBScript
  9. 'Version : 1.0
  10. 'Author  : KS-Soft (www.ks-soft.net)
  11. '-----------------------------------------------------------------------------
  12. Option Explicit
  13.  
  14. const statusAlive       = "Host is alive:"
  15. const statusDead        = "No answer:"
  16. const statusUnknown     = "Unknown:"
  17. const statusNotResolved = "Unknown host:"
  18. const statusOk          = "Ok:"
  19. const statusBad         = "Bad:"
  20. const statusBadContents = "Bad contents:"
  21.  
  22. const IEkey = "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page"
  23.  
  24. '---- entry point ----
  25.  
  26. FUNCTION performtest()
  27.   Dim WshShell, KeyStr
  28.   IF "%Reply%"="%"+"Reply"+"%" THEN
  29.      performtest = statusUnknown+"Please enable 'Translate macros' option"
  30.   ELSE
  31.     Set WshShell = CreateObject("WScript.Shell")
  32.     KeyStr = WshShell.RegRead(IEkey)
  33.     IF (KeyStr<>"%Reply%") THEN
  34.        performtest = statusBad+KeyStr
  35.     ELSE
  36.        performtest = statusOk+KeyStr
  37.     END IF
  38.   END IF
  39. END FUNCTION
  40.