| View previous topic :: View next topic |
| Author |
Message |
henrywood Contributor

Joined: 21 Sep 2004 Posts: 66 Location: Copenhagen, Denmark
|
Posted: Mon Jun 04, 2007 10:30 pm Post subject: Using devcon.exe to install local and remote printer drivers |
|
|
Hi guys !
I would like to use the devcon tool by M$ to automatically install a
1. Local printer
2. Network printer
3. A Videodriver
via an INF
According to the devcon help the syntax is:
devcon [-r] install <inf> <hwid>
Manually installs a device.
This command will only work for local machine.
Specify -r to reboot automatically if needed.
<inf> is an INF to use to install the device.
<hwid> is a hardware ID to apply to the device.
Now my question is: How do I specify the hwid ? Is it in somewhere in the .INF file ?
Also, how to I tell devcon to map a certain local port to a remote network printer.
And last, what is the HWID to use in case of a videodriver ?
Henrik |
|
| Back to top |
|
 |
DaveR Valued Contributor


Joined: 03 Sep 2005 Posts: 413 Location: Australia
|
Posted: Tue Jun 05, 2007 2:57 am Post subject: Re: Using devcon.exe to install local and remote printer dri |
|
|
| henrywood wrote: | | Now my question is: How do I specify the hwid ? Is it in somewhere in the .INF file ? |
I believe it's in the inf file. But you'll have to look in the file and find it, as it can be in different places. And some devices have multiple hardware ids. In the example below the hardware id is USB\VID_11DB&PID_1000
| Code: | [DeviceList] ;; MSDN: INF Models Section
%VID_11DB&PID_1000.DeviceDesc%=DriverInstall,USB\VID_11DB&PID_1000 ;; First device
%VID_11DB&PID_1100.DeviceDesc%=DriverInstall,USB\VID_11DB&PID_1100 ;; Second device
|
and in this next example (below) there are 5 of them (PCI\VEN_104A&DEV_0010&REV_##).
| Code: | [Manufacturer]
%Manufacturer%=Mfg
[Mfg]
"PowerVR KYRO 32MB/64MB"=KYRO,PCI\VEN_104A&DEV_0010&REV_01
"PowerVR KYRO II 32MB/64MB"=KYROII,PCI\VEN_104A&DEV_0010&REV_05
"PowerVR KYRO II 32MB/64MB"=KYROII,PCI\VEN_104A&DEV_0010&REV_07
"PowerVR KYRO II 32MB/64MB"=KYROII,PCI\VEN_104A&DEV_0010&REV_0F
"PowerVR KYRO II 32MB/64MB"=KYROII,PCI\VEN_104A&DEV_0010&REV_1F |
though in device manager the hardware ids for this video card show up as:
PCI\VEN_104A&DEV_0010&SUBSYS_E810104A&REV_0F
PCI\VEN_104A&DEV_0010&SUBSYS_E810104A
PCI\VEN_104A&DEV_0010&CC_030000
PCI\VEN_104A&DEV_0010&CC_0300
so I'm not sure where it's getting the blue bits of info from?
| henrywood wrote: | | Also, how to I tell devcon to map a certain local port to a remote network printer. |
I don't know, sorry. _________________ cheers
Dave |
|
| Back to top |
|
 |
henrywood Contributor

Joined: 21 Sep 2004 Posts: 66 Location: Copenhagen, Denmark
|
Posted: Tue Jun 05, 2007 5:10 pm Post subject: |
|
|
Thanks Dave !
So I guess the conclusion is that you have to know the HWID from the INF file to install that particular driver / device
Also, to answer my own question regarding mapping a local port to a network printer, I discovered that one can use
runh net use lpt2: \\printerserver\share,wait
Thanks for your help
Henrik |
|
| Back to top |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Jun 05, 2007 6:02 pm Post subject: |
|
|
Henrik,
Just to let you know there is a AddPrinterConnection method which is part of the Win32_Printer WMI class that should do the same. I have a demo at my forum that shows some of the abilities of the Win32_Printer WMI class. There is also a Win32_PrinterDriver WMI class that has a AddPrinterDriver method. Using WMI would allow you to connect to the machines remotely and install/configure the Printers without having to goto every machine or installing additional software on each machine. _________________ Home of
Give VDS a new purpose!
 |
|
| Back to top |
|
 |
henrywood Contributor

Joined: 21 Sep 2004 Posts: 66 Location: Copenhagen, Denmark
|
Posted: Tue Jun 05, 2007 6:59 pm Post subject: |
|
|
dragonsphere,
I will look into this as well
thx
Henrik |
|
| Back to top |
|
 |
|