Discussion:
prndrvr waiting from prompt
(too old to reply)
Cameron Shaw
2010-01-07 17:20:46 UTC
Permalink
I've built a script that add a Xerox driver, creates a tcp/ip port and
install the printer. The script itself works fine, but there is an issue
with Xerox drivers where the only way to change the driver defaults is to
create a config file and have that copied into your source.

From what I can tell though as soon as you copy the config file the driver
is no longer recognized as WHQL certified as it will prompt during an manual
install to continue or stop. You only see this message if you've copied the
config file in.

This is important because I noticed that if I used the default drivers the
script worked fine, but as soon as I copied in the config file the script
wouldn't install the drivers. No error message would appear, nothing. The
script would just stop.

What occured to me this morning is that it stops as almost exactly the same
point where if you did the install manually it would ask if you wanted to
continue or stop. The problem is I get no such prompt nor can I find any
options to deal with this.

Below is a link to the Technet page on adding the driver

http://technet.microsoft.com/en-us/library/cc754632(WS.10).aspx

I've also copied in my script as well as a reference point. I've replaced
the ip's in this but the script itself works fine.

I was hoping somewhat might have encountered something similar.

************************************************
Const HKEY_LOCAL_MACHINE = &H80000002
Set objNetwork = CreateObject("Wscript.Network")
Set WshShell = CreateObject("Wscript.shell")
strComputer = objNetwork.ComputerName
set filesys=CreateObject("Scripting.FileSystemObject")

Set objRegistry = GetObject("winmgmts:\\" & strComputer &
"\root\default:StdRegProv")
strKeyPath = "SYSTEM\ControlSet001\Control\Print\Environments\Windows NT
x86\Drivers\Version-3\Xerox Global Print Driver PS\"
strValueName = "Driver"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue

If IsNull(dwValue) Then

'Maps Network Drive
objNetwork.MapNetworkDrive "X:", \\Server\Share

'Copies Driver
filesys.CopyFolder "X:\Xerox", "c:\Temp\Xerox"

'Install Driver
WshShell.Run "%COMSPEC% /c cscript C:\Windows\System32\prndrvr.vbs -a -m
" & chr(34) & "Xerox Global Print Driver PS" & chr(34) & " -v 3 -e " &
chr(34) & "Windows NT x86" & chr(34) & " -h " & chr(34) & "C:\Temp\Xerox" &
chr(34) & " -i " & chr(34) & "C:\Temp\Xerox\x2UNIVP.inf" & chr(34) & "", 0,
true

'Delete Mapped Drive
objNetwork.RemoveNetworkDrive "X:"

'Deletes Temp Folder For Driver
set delfolder = filesys.GetFolder("c:\Temp\Xerox\")
delfolder.Delete
End If

strKeyPath = "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Print\Printers\Xerox ColorQube 2nd Floor - 1\"
strValueName = "Name"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then

'Install Xerox 2nd Floor #1
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnport.vbs -a -r "
& chr(34) & "IP_X.X.X.X" & chr(34) & " -h " & chr(34) & "X.X.X.X" & chr(34)
& " -o raw", 0, true
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnmngr.vbs -a -p "
& chr(34) & "Xerox ColorQube 2nd Floor - 1" & chr(34) & " -r " & chr(34) &
"IP_X.X.X.X" & chr(34) & " -m " & chr(34) & "Xerox Global Print Driver PS" &
chr(34) & "", 0, true
End If

strKeyPath = "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Print\Printers\Xerox ColorQube 3rd Floor - 1\"
strValueName = "Name"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then

'Install Xerox 3rd Floor #1
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnport.vbs -a -r "
& chr(34) & "IP_X.X.X.X" & chr(34) & " -h " & chr(34) & "X.X.X.X" & chr(34)
& " -o raw", 0, true
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnmngr.vbs -a -p "
& chr(34) & "Xerox ColorQube 3rd Floor - 1" & chr(34) & " -r " & chr(34) &
"IP_X.X.X.X" & chr(34) & " -m " & chr(34) & "Xerox Global Print Driver PS" &
chr(34) & "", 0, true
End If


strKeyPath = "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Print\Printers\Xerox ColorQube 3rd Floor - 2\"
strValueName = "Name"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then

'Install Xerox 3rd Floor #2
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnport.vbs -a -r "
& chr(34) & "IP_X.X.X.X" & chr(34) & " -h " & chr(34) & "X.X.X.X" & chr(34)
& " -o raw", 0, true
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnmngr.vbs -a -p "
& chr(34) & "Xerox ColorQube 3rd Floor - 2" & chr(34) & " -r " & chr(34) &
"IP_X.X.X.X" & chr(34) & " -m " & chr(34) & "Xerox Global Print Driver PS" &
chr(34) & "", 0, true
End If
wscript.quit
***************************************************
Alan Morris [MSFT]
2010-01-09 17:57:46 UTC
Permalink
You can not use WMI to install unsigned print drivers

Try the printui.dll interfaces using rundll32. You can disable the signing
warning for printui but WMI will not be tricked.

rundll32 printui.dll,PrintUIEntry /?
--
Alan Morris
Windows Printing Team
Search the Microsoft Knowledge Base here:
http://support.microsoft.com/search/?adv=1

This posting is provided "AS IS" with no warranties, and confers no rights.
Post by Cameron Shaw
I've built a script that add a Xerox driver, creates a tcp/ip port and
install the printer. The script itself works fine, but there is an issue
with Xerox drivers where the only way to change the driver defaults is to
create a config file and have that copied into your source.
From what I can tell though as soon as you copy the config file the driver
is no longer recognized as WHQL certified as it will prompt during an
manual install to continue or stop. You only see this message if you've
copied the config file in.
This is important because I noticed that if I used the default drivers the
script worked fine, but as soon as I copied in the config file the script
wouldn't install the drivers. No error message would appear, nothing. The
script would just stop.
What occured to me this morning is that it stops as almost exactly the
same point where if you did the install manually it would ask if you
wanted to continue or stop. The problem is I get no such prompt nor can I
find any options to deal with this.
Below is a link to the Technet page on adding the driver
http://technet.microsoft.com/en-us/library/cc754632(WS.10).aspx
I've also copied in my script as well as a reference point. I've replaced
the ip's in this but the script itself works fine.
I was hoping somewhat might have encountered something similar.
************************************************
Const HKEY_LOCAL_MACHINE = &H80000002
Set objNetwork = CreateObject("Wscript.Network")
Set WshShell = CreateObject("Wscript.shell")
strComputer = objNetwork.ComputerName
set filesys=CreateObject("Scripting.FileSystemObject")
Set objRegistry = GetObject("winmgmts:\\" & strComputer &
"\root\default:StdRegProv")
strKeyPath = "SYSTEM\ControlSet001\Control\Print\Environments\Windows NT
x86\Drivers\Version-3\Xerox Global Print Driver PS\"
strValueName = "Driver"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then
'Maps Network Drive
objNetwork.MapNetworkDrive "X:", \\Server\Share
'Copies Driver
filesys.CopyFolder "X:\Xerox", "c:\Temp\Xerox"
'Install Driver
WshShell.Run "%COMSPEC% /c cscript C:\Windows\System32\prndrvr.vbs -a -m
" & chr(34) & "Xerox Global Print Driver PS" & chr(34) & " -v 3 -e " &
chr(34) & "Windows NT x86" & chr(34) & " -h " & chr(34) & "C:\Temp\Xerox"
& chr(34) & " -i " & chr(34) & "C:\Temp\Xerox\x2UNIVP.inf" & chr(34) & "",
0, true
'Delete Mapped Drive
objNetwork.RemoveNetworkDrive "X:"
'Deletes Temp Folder For Driver
set delfolder = filesys.GetFolder("c:\Temp\Xerox\")
delfolder.Delete
End If
strKeyPath = "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Print\Printers\Xerox ColorQube 2nd Floor - 1\"
strValueName = "Name"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then
'Install Xerox 2nd Floor #1
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnport.vbs -a -r
" & chr(34) & "IP_X.X.X.X" & chr(34) & " -h " & chr(34) & "X.X.X.X" &
chr(34) & " -o raw", 0, true
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnmngr.vbs -a -p
" & chr(34) & "Xerox ColorQube 2nd Floor - 1" & chr(34) & " -r " & chr(34)
& "IP_X.X.X.X" & chr(34) & " -m " & chr(34) & "Xerox Global Print Driver
PS" & chr(34) & "", 0, true
End If
strKeyPath = "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Print\Printers\Xerox ColorQube 3rd Floor - 1\"
strValueName = "Name"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then
'Install Xerox 3rd Floor #1
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnport.vbs -a -r
" & chr(34) & "IP_X.X.X.X" & chr(34) & " -h " & chr(34) & "X.X.X.X" &
chr(34) & " -o raw", 0, true
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnmngr.vbs -a -p
" & chr(34) & "Xerox ColorQube 3rd Floor - 1" & chr(34) & " -r " & chr(34)
& "IP_X.X.X.X" & chr(34) & " -m " & chr(34) & "Xerox Global Print Driver
PS" & chr(34) & "", 0, true
End If
strKeyPath = "SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Print\Printers\Xerox ColorQube 3rd Floor - 2\"
strValueName = "Name"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue
If IsNull(dwValue) Then
'Install Xerox 3rd Floor #2
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnport.vbs -a -r
" & chr(34) & "IP_X.X.X.X" & chr(34) & " -h " & chr(34) & "X.X.X.X" &
chr(34) & " -o raw", 0, true
WshShell.Run "%COMSPEC% /c cscript C:\Windows\system32\prnmngr.vbs -a -p
" & chr(34) & "Xerox ColorQube 3rd Floor - 2" & chr(34) & " -r " & chr(34)
& "IP_X.X.X.X" & chr(34) & " -m " & chr(34) & "Xerox Global Print Driver
PS" & chr(34) & "", 0, true
End If
wscript.quit
***************************************************
Loading...