I got this piece of winst code to install printer driver on Win10...
Code: Alles auswählen
Message "Installation des drivers par WinBatch"
UpdateEnvironment
WinBatch_pnputil_10 /RunElevated
[WinBatch_pnputil_10]
%system%\PNPUtil.exe /add-driver c:\drv-imp\*.inf /subdirs /install
I tried wihtout UpdateEnvironment, or without %system% it's the same.
Code: Alles auswählen
[5] [sept. 25 22:42:04:409] [recia-printer-driver-install] message Installation des drivers par WinBatch
[5] [sept. 25 22:42:04:413] [recia-printer-driver-install] Execution of: WinBatch_pnputil_10 /RunElevated
[5] [sept. 25 22:42:04:413] [recia-printer-driver-install]
[4] [sept. 25 22:42:04:413] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:04:825] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:05:230] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:05:634] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:06:037] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:06:442] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:06:847] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:07:252] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:07:656] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:08:060] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe -retrying
[4] [sept. 25 22:42:08:465] [recia-printer-driver-install] Warning: file not found :C:\Windows\system32\PNPUtil.exe - giving up
[6] [sept. 25 22:42:08:465] [recia-printer-driver-install] Call "C:\Windows\system32\PNPUtil.exe /add-driver c:\drv-imp\*.inf /subdirs /install"
[6] [sept. 25 22:42:08:466] [recia-printer-driver-install] Waiting until the called process is finished
[6] [sept. 25 22:42:08:466] [recia-printer-driver-install] Start process elevated ....
[3] [sept. 25 22:42:08:473] [recia-printer-driver-install] C:\Windows\system32\PNPUtil.exe /add-driver c:\drv-imp\*.inf /subdirs /install .... CreateProcessAsUser Error 2 (Le fichier spécifié est introuvable.)
[3] [sept. 25 22:42:08:473] [recia-printer-driver-install] Error: C:\Windows\system32\PNPUtil.exe /add-driver c:\drv-imp\*.inf /subdirs /install .... CreateProcessAsUser Error 2 (Le fichier spécifié est introuvable.)
The same line " C:\Windows\system32\PNPUtil.exe /add-driver c:\drv-imp\*.inf /subdirs /install " does work in a terminal command (event launch as system with psexec).
Any idea ?
Regards,
Nico