• Join Us |
  • |
  • Sign in with:

Evening Reading

by Maarten Goldstein, May 05, 2006 6:14pm PDT
Related Topics – Wack News

No need to gift-wrap these

- It's hard out there for a pro athlete sentenced to community service. - Dog curfew in Norwegian town. - Guy wanted to be excused from jury, didn't quite happen. - Australian hookers can deduct sex toys on their tax returns.
Lastly, Top 15 Ways to Live Longer.





























  • could someone who knows about vb script tell me whats wrong with this

    ' declare variables
    Dim strComputer
    Dim strDisplayName
    Dim strDisplayVersion
    Dim strRestrictedSoftware

    ' declare constants
    Const ForReading = 1
    Const ForAppending = 8
    Const HKLM = &H80000002

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv" )
    ' obtain computer name
    strComputerName = "SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName\"
    objReg.EnumKey HKLM, strComputerName
    objReg.GetStringValue HKLM, strComputerName & subkey,"ComputerName",strHostname
    ' enumerate installed software
    strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"
    objReg.EnumKey HKLM, strKeyPath, arrSubKeys


    ' obtain installed software
    For Each subkey In arrSubKeys
    objReg.GetStringValue HKLM, strKeyPath & subkey,"DisplayName",strDisplayName
    objReg.GetStringValue HKLM, strKeyPath & subkey,"DisplayVersion",strDisplayVersion

    Set objAuditLog = objFSO.OpenTextFile ("AuditLog.htm", ForAppending, True)
    'write line to file opened above
    objAuditLog.Write (DATE & "," & TIME & "," & strDisplayName & "," & strDisplayVersion) & vbCrLf
    'close text file
    objAuditlog.Close