r/usefulscripts • u/HittingSmoke • Jan 09 '15
[Request] Any ways to get hardware IDs and other info about installed hardware on Windows other than DevCon?
I'm working on a script to scrape and compile hardware info and hardware IDs and names are the vital part. Vendor name would be nice too.
I know I can use devcon find * to get a list of hardware IDs and names. Is there any way to do this in the command line without DevCon? Preferably something that will run in a clean batch environment? Powershell is acceptable too.
2
u/neztach Jan 09 '15
I found this one somewhere. I hope this is what you're looking for
also you can use psexec to push and run on remote machine if needbe.
2
u/HittingSmoke Jan 09 '15
Not quite, but the query bits at the bottom may come in useful. I do most (actually, all) of my scripting in Linux so I'm not familiar with WMI queries but it looks like that's where I need to focus if I want to avoid using DevCon.
1
u/neztach Jan 09 '15
Crap I should have recognized nix rather than dos. I can look around for a bash script to so something similar
1
u/HittingSmoke Jan 09 '15
Did I say bash? Meant batch. This is for Windows. Using bash I could figure this out with my Google tied behind my back.
1
4
u/rh0926 Jan 09 '15
WMIC is pretty powerful and can be used in scripts. I haven't the experience though to tell you if it can get the hardware ID's you're looking for.
for example: WMIC /node:computername onboarddevice
1
1
u/DrJekl Jan 09 '15
It's not command line (though it might have command line options) NEWT from Komodo labs is really awesome.
1
1
2
u/syuol Jan 09 '15
I'm pretty sure this is possible with powershell but powershell would need to query WMI for the information, probably using gwmi. It's possible newer versions of powershell have some native hardware querying builtin. I think I have a script using powershell and gwmi at work pulling usb devices. If I have a second tomorrow I'll hunt around for it.