i need some help
any help in this
i want to get the history of devices logged in the pc
only i need the date it logged in and the serial number
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Mar 20, 2013, 7:51 AM
You'd think that, if you're using Vista or later, it would be a simple matter of querying the WMI class, Win32_DiskDrive, to get this information:
http://msdn.microsoft.com/en-gb/library/windows/desktop/aa394132(v=vs.85).aspx
However, for the devices I tried, the SerialNumber property gave silly answers and the InstallDate property didn't work at all!
I did eventually figure out that you could parse out the serial number from the PNPDeviceID property and the following code shows how to do that:
As far as the log in date is concerned, I couldn't find any way to get at this statically but there's a Code Project article here which shows how to detect in real time when devices are plugged-in and removed which may be of some help to you:
http://www.codeproject.com/Articles/63878/Enumerate-and-Auto-Detect-USB-Drives#AWalkAroundWMI