Getting Windows 10 Device ID Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
epete
Posts: 81
Joined: 02 Dec 2020, 10:03

Getting Windows 10 Device ID

Post by epete » 21 Sep 2021, 14:31

Is there a reliable way to get the machine "Device ID"? That is found in Settings | System | About ?
I have been reading it from the registry at:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OneSettings\WSD\SetupPlatform\QueryParameters
But, had a customer that it turned up blank on - instead their Device ID was in:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\OneSettings\WSD\UpdateAgent\QueryParameters

On my machine it is in both places. Is one more reliable than the other? I don't know the difference between the two.

Would like some code to find the DeviceID reliably on any Windows 10 machine.
User avatar
mikeyww
Posts: 26602
Joined: 09 Sep 2014, 18:38

Re: Getting Windows 10 Device ID  Topic is solved

Post by mikeyww » 21 Sep 2021, 14:47

What I read anyway:

Code: Select all

MsgBox, 64, Device ID, % deviceID()

deviceID() {
 RegRead, deviceID, HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\SQMClient, MachineId
 Return RegExReplace(deviceID, "[{}]")
}
Post Reply

Return to “Ask for Help (v1)”