Nine Posted 20 hours ago Posted 20 hours ago Try powershell : Get-PhysicalDisk | Select-Object FriendlyName, DeviceID, SerialNumber, AdapterSerialNumber AdapterSerialNumber looks good. Parsix and argumentum 1 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Parsix Posted 18 hours ago Posted 18 hours ago 1 hour ago, Nine said: Try powershell : Get-PhysicalDisk | Select-Object FriendlyName, DeviceID, SerialNumber, AdapterSerialNumber AdapterSerialNumber looks good. nice, must be we look for it in wmi classes
UEZ Posted 2 hours ago Posted 2 hours ago (edited) I didn't read all the posts in this thread. I found an old WMI script which returns the s/n: expandcollapse popupGlobal $oErrorHandler = ObjEvent("AutoIt.Error", "ObjErrorHandler") MsgBox(0, "Test", WMI_GetHDDSN(".")) Func WMI_GetHDDSN($host, $usr = "", $pass = "") ;coded by UEZ 2011 If $host = "." Then $host = "localhost" Local $HDD_SN Local $ping = Ping($host, 1000) If @error Then Return SetError(1, 0, -1) Local $objWMILocator = ObjCreate("WbemScripting.SWbemLocator") Local $objWMIService = $objWMILocator.ConnectServer($host, "\root\cimv2", $usr, $pass, "", "", 128) If @error Then Return SetError(2, 0, -1) Local $colItems = $objWMIService.ExecQuery("SELECT Model, Name, SerialNumber FROM Win32_DiskDrive WHERE MediaType='Fixed hard disk media'", "WQL", 0x30) If IsObj($colItems) Then For $objItem In $colItems $HDD_SN &= "Model: " & $objItem.Model & ", S/N: " & WMI_GetHDDSN2(StringMid($objItem.Name, 5), $host, $usr, $pass) & @LF Next Else Return SetError(3, 0, -1) EndIf Return $HDD_SN EndFunc Func WMI_GetHDDSN2($Tag, $host, $usr = "", $pass = "") ;coded by UEZ 2011 Local $HDD_SN Local $objWMILocator = ObjCreate("WbemScripting.SWbemLocator") Local $objWMIService = $objWMILocator.ConnectServer($host, "\root\cimv2", $usr, $pass, "", "", 128) Local $colItems = $objWMIService.ExecQuery("SELECT SerialNumber,Tag FROM Win32_PhysicalMedia WHERE Tag LIKE '%" & $Tag & "%'", "WQL", 0x30) If IsObj($colItems) Then For $objItem In $colItems ;~ ConsoleWrite($objItem.Tag & @LF) $HDD_SN = $objItem.SerialNumber Next Else Return SetError(3, 0, -1) EndIf Return $HDD_SN EndFunc Func ObjErrorHandler() ConsoleWrite( "A COM Error has occured!" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oErrorHandler.description & @CRLF & _ "err.windescription:" & @TAB & $oErrorHandler & @CRLF & _ "err.number is: " & @TAB & Hex($oErrorHandler.number, 8) & @CRLF & _ "err.lastdllerror is: " & @TAB & $oErrorHandler.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oErrorHandler.scriptline & @CRLF & _ "err.source is: " & @TAB & $oErrorHandler.source & @CRLF & _ "err.helpfile is: " & @TAB & $oErrorHandler.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oErrorHandler.helpcontext & @CRLF _ ) EndFunc I don't know if this is what you guys are looking for. Edited 2 hours ago by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
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