Hello,
I sure hope someone can pull my head out...
OK, I have a USB device that I want to see if its present or plugged
in. Now, this works fine, using cscript on the client as a VBS:
**********************************************************
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
strValue = "Device Not Found!"
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PnPEntity
WHERE service = 'HidUsb'",,48)
For Each objItem in colItems
strKeyPath = "SYSTEM\CurrentControlSet\Enum\" & objItem.DeviceID
Next
if len(strKeyPath) > 1 then
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
strEntryName = "LocationInformation"
objReg.GetExpandedStringValue HKEY_LOCAL_MACHINE, strKeyPath,
strEntryName, strValue
end if
Wscript.Echo strValue
**********************************************************
When the device is attached objItem.DeviceID returns a portion of the
registry KEY, and I get the value from the registry
LocationInformation. When unplugged I get Device Not Found!
Wonderful, works great.
Problem...
How would I do this using ASP and client side scripting? IIS6.0 would
be the host of the ASP, clients are Windows XP Pro.
Nothing fancy, just a response.write to the clients browser with whats
contained in strValue.
Thanks
ninefofo