Hy Jwoegerbauer,
Test device HD2 energy rom, Dft leo USB host
I look and try Yours code and i have some errors ( if without if )
Here is a reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097\Default\8]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097\Default\8\MODEM_PPP_PORT]
"Dll"="PPPVSP.DLL"
"Prefix"="COM"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default\255_255]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0Default\255_255\HUAWEI_MODEM_PORT]
"Prefix"="COM"
"Dll"="PPPVSP.DLL"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default\8]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default\8\HUAWEI_MODEM_PORT]
"Prefix"="COM"
"Dll"="PPPVSP.DLL"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504\Default\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504\Default\Default\USBMouse]
"Cursor"=dword:00000001
"Mode"=dword:00000000
"Dll"="USBMouse"
Every usb devices is stored under "loadClients sub key in format VID_PID_N
Example last line hklm.........loadclients\1133_49243_21504\...........
in this line 1133 is a PID, and 49243 is a VID
How can wi use key name "1133_49243_21504" and split key text VID_PID_N to
PID=1133
VID=49243
Num=21504
Thanks In advance,
---------- Post added at 02:58 PM ---------- Previous post was at 02:40 PM ----------
==============================================================================================
Hy Jwoegerbauer,
Itry somting
But Idont know english weru well
Code
#####LIST_LOAD_CLIENTS_DRIVERS####
#include\load.txt
root = "HKLM"
path= "Drivers\USB\LoadClients"
nam = ""
val = ""
#---
ForEach k in regSubKeys (root,path)
#ForEach v,d in regValues (root,path & "\" & k)
#If (Find (d,val) && nam eq RegRead (root,path & "\" & key,"Name"))
#Message ("kluc: " & v & "^NL^znacenje: " & root & "\" & path & "\" & k)
#Run \load.txt, &number&
#SetClipText %number%
#i=( root,path,\ & k)
#WriteFile \load.txt,%K%^NL^
Sleep(500)
Message ("Key: " & k & "^NL^PID: " & d & "^NL^VID: " & d,root & "\" & path )
#EndForEach
EndForEach
-------------------------------------------------------------------------------------------------------------------------------------
Test device HD2 energy rom, Dft leo USB host
I look and try Yours code and i have some errors ( if without if )
Here is a reg
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097\Default\8]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4097\Default\8\MODEM_PPP_PORT]
"Dll"="PPPVSP.DLL"
"Prefix"="COM"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default\255_255]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0Default\255_255\HUAWEI_MODEM_PORT]
"Prefix"="COM"
"Dll"="PPPVSP.DLL"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default\8]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\2800_26993_0\Default\8\HUAWEI_MODEM_PORT]
"Prefix"="COM"
"Dll"="PPPVSP.DLL"
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504\Default\Default]
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\1133_49243_21504\Default\Default\USBMouse]
"Cursor"=dword:00000001
"Mode"=dword:00000000
"Dll"="USBMouse"
Every usb devices is stored under "loadClients sub key in format VID_PID_N
Example last line hklm.........loadclients\1133_49243_21504\...........
in this line 1133 is a PID, and 49243 is a VID
How can wi use key name "1133_49243_21504" and split key text VID_PID_N to
PID=1133
VID=49243
Num=21504
Thanks In advance,
---------- Post added at 03:28 PM ---------- Previous post was at 02:58 PM ----------
Hy Jwoegerbauer,
I ad "EndIf" at the end of code and it works,
Yors Code with (LoadClints), I think poss_PID is not "0", must be after poss_vid
// assume error
found_usb_device=0
If(RegKeyExists("HKLM","drivers\usb\loadclients"))
ForEach usb_device In RegSubKeys("HKLM","drivers\usb\loadclients")
pos_vid=0
pos_pid=0
If(usb_device NE "")
// subkey looks like Vid_<vid>&Pid_<pid>
// search for vendor ID
pos_vid=Find(usb_device,"Vid_")
// vid found?
If(pos_vid)
// advance 4 characters
pos_vid+=4
// read next 4 charcters (bytes)
vid=SubStr(usb_device,pos_vid,4)
// search for product ID
pos_pid=Find(usb_device,"Pid_")
// pid found ?
If(pos_pid)
// advance 4 characters
pos_pid+=4
// read next 4 characters (bytes)
pid=SubStr(usb_device,pos_pid,4)
EndIf
EndIf
If(pos_vid&&pos_pid)
Message("USB device found:^NL^VID "&vid&^NL^PID"&pid)
// indicate success
found_usb_device+=1
EndIf
EndIf
EndForEach
EndIf
If(NOT found_usb_device)
Message("No USB device found")
EndIf
Thanks, Best Regards