#!c:\WINDOWS\system32\cscript.exe /nologo "C:\wamp\cgi-bin\vbscript_cgi.vbs"
''''''''''''''''''''''''''''''
'' testscript.vbs ''
'' Kevin DEHLINGER ''
'' 2007 / dev.pulsed.net ''
'' query some data with ''
'' wmi/wsh (some of thecode ''
'' comes from scriptomatic) ''
''''''''''''''''''''''''''''''
print "Content-type: text/html" & vbcrlf
print "" & vbcrlf & _
"" & _
"
" & _
" " & _
" " & _
"" & _
""
Set mycgivars=GetCgiVars
if mycgivars.exists("computer") then
computer=mycgivars.item("computer")
else
computer = "."
end if
print ""
On Error Resume Next
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
println "Computer: " & computer & "
"
Set objWMIService = GetObject("winmgmts:\\" & computer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_LogicalDisk", "WQL", _
wbemFlagReturnImmediately + wbemFlagForwardOnly)
For Each objItem In colItems
println "Drive: " & objItem.Caption & "
"
println "Description: " & objItem.Description & "
"
println "VolumeName: " & objItem.VolumeName & "
"
println "
"
Next
print ""
Function WMIDateStringToDate(dtmDate)
print dtm:
WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
& " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function