Belini Posted July 1, 2013 Share Posted July 1, 2013 Which command shows the model and brand of flash drive? My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted July 2, 2013 Author Share Posted July 2, 2013 A code posted by @Joelson0007 solved the problem. #include <String.au3> #include <Array.au3> $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2") $r = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", 0x10 + 0x20) For $o In $r $aRet = _StringExplode($o.PNPDeviceID, "\") Switch $aRet[0] Case 'USBSTOR' $aID = StringRegExp($aRet[1], "VEN_(.*?)&", 3) if (IsArray($aID))Then MsgBox(4096, 'USB', 'Name = ' & $o.Caption & @CRLF _ & 'ID = ' & @CRLF & $o.PNPDeviceID & @CRLF _ & 'Manufactured = ' & $aID[0]) EndIf EndSwitch Next My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Belini Posted July 6, 2013 Author Share Posted July 6, 2013 I made some changes to the code, may serve someone well. #include <String.au3> #include <Array.au3> Local $vCryptKey = "2.lt= eocut/ 2cbotbvçhkth9o efewgs:^QA$25t45twhtdn.l" Local $aArray[1], $informat = "", $aRegExSer = 0 $aArray[0] = "1" Local $objWMIService = ObjGet("winmgmts:{impersonationLevel=Impersonate}!\\.\root\cimv2") Local $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", 0x10 + 0x20) For $objitem In $colItems If $objitem.interfacetype = "USB" Then $objitem.pnpdeviceid $aRegExSer = StringRegExp($objitem.pnpdeviceid, "\x5C([0-9a-fxA-FX]+)&", 3) If IsArray($aArray) Then $aRet = _StringExplode($objitem.PNPDeviceID, "\") $aID = StringRegExp($aRet[1], "VEN_(.*?)&", 3) _ArrayAdd($aArray, $aRegExSer[0]) $informat = "Number= " & $aRegExSer[0] & @CRLF & "Name = " & $objitem.Caption & @CRLF & _ "ID = " & $objitem.PNPDeviceID & @CRLF & "Made for = " & $aID[0] MsgBox(4096, "", $informat) EndIf EndIf Next My Codes: Virtual Key Code UDF: http://www.autoitscript.com/forum/topic/138246-virtual-key-code-udf/ GuiSplashTextOn.au3: http://www.autoitscript.com/forum/topic/143542-guisplashtexton-udf/ Menu versions of Autoit: http://www.autoitscript.com/forum/topic/137435-menu-versions-of-autoit/#entry962011 Selects first folder of letters: ]http://www.autoitscript.com/forum/topic/144780-select-folders-by-letter/#entry1021708/spoiler] List files and folders with long addresses.: http://www.autoitscript.com/forum/topic/144910-list-files-and-folders-with-long-addresses/#entry102 2926 Program JUKEBOX made in Autoit:some functions:http://www.youtube.com/watch?v=WJ2tC2fD5Qs Navigation to search:http://www.youtube.com/watch?v=lblwOFIbgtQ Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now