"benoit DUQUESNE" <***@gmail.com> wrote
| Is it possible to make a VBSCRIPT (for Windows 10) which can recover in a
TXT file the serial numbers of the printers installed on a station ?
|
That would imply a software serial number and not
just a hardware serial number. Are you sure such a thing
exists? Serial numbers are usually listed on stickers.
For what it's worth, you can get some info via WMI,
but these are the only identifying properties I found
for printers:
'---------------------------------
Dim WMI, Col, Ob, S2
On Error Resume Next
Set WMI = GetObject("WinMgmts:")
Set Col = WMI.ExecQuery("Select * from Win32_Printer")
For Each Ob in Col
S2 = S2 & "Product Name: " & Ob.DeviceID & vbCrLf
S2 = S2 & "Product Version: " & Ob.DriverName & vbCrLf
S2 = S2 & "Product Description: " & Ob.PNPDeviceID & vbCrLf
Next
Set Col = Nothing
Set WMI = Nothing
MsgBox S2
'--------------------------------
On my system it returns the following:
Product Name: Microsoft XPS Document Writer
Product Version: Microsoft XPS Document Writer
Product Description:
Product Name: HP ENVY 5660 series
Product Version: HP ENVY 5660 series
Product Description:
Product Name: CutePDF Writer
Product Version: CutePDF Writer
Product Description:
Not very useful. You can also connect to a printer
scanner via WIA, but I don't see anything there
about serial numbers. Microsoft are fanatic about
identifying hardware and WMI provides options for
most onboard hardware elements, so I'm guessing printers
don't have a software ID.
You can access most/all printer settings and the printer
driver via WMI, but I don't see anything about unique
IDs.
If you want to pursue that, there should be a wmisdk.hks
file in the Win32 SDK. If you don't want to install that whole
mess the hxs can be extracted and converted to CHM. If
you start getting into WMI you'll want the help. It's a
very extensive system that's been very poorly designed.
There's nothing obvious or intuitive, and as you can see
above, it's not so much an object model as a fake SQL
database. Crazy stuff.