i use another solution which works only with xp and above

i try to add different printers in my install. here my list
- rundll32 like
rundll32 printui.dll,PrintUIEntry /if /x /n "Imprimante HP4100" /m "HP
Laserjet 4100 Series PCL"  /r "http://X.X.X.X"; /f
%windir%\inf\ntprint.inf /b "HP-LJ-4100"
http://support.microsoft.com/default.aspx?scid=kb;EN-US;189105
http://support.microsoft.com/default.aspx?scid=kb;en-us;314486

- autoit (hard, the setup is inconsistent, as assistant keeps last answer)

- ms script on xp
prncnfg.vbs, prndrvr.vbs, prnjobs.vbs, prnmngr.vbs, prnport.vbs,
prnqctl.vbs, pubprn.vbs
http://msdn.microsoft.com/chats/windows/windows_101602.asp
the adding port script takes a 100% of cpu (with a Wmi process) and does
nothing on the box i use (pristine unattended xpsp1).

then main problem is setting up a tcp/ip port

this link is not complete
https://engineering.purdue.edu/ECN/Resources/KnowledgeBase/Docs/20040216090320
it does not work on my winxpsp1 even with some little changes

now the real solution i use but works only with xp

=== AddPrinterTcpIPport.vbs
' http://www.experts-exchange.com/Operating_Systems/Win2000/Q_21018860.html
' http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_tcpipprinterport.asp
' http://www.microsoft.com/technet/community/scriptcenter/printing/scrprn09.mspx


' Arguments to be: ip, proto
'       if raw: port
'       if lpr: queue name

if Wscript.Arguments.Count = 0 then
        WScript.Echo "Usage: [cscript | wscript] AddPrinterTcpIPport.vbs
ip proto [extra]"
        WScript.Quit 1
end if

IP = Wscript.Arguments.Item(0)
proto = Wscript.Arguments.Item(1)
'extra = Wscript.Arguments.Item(2)
'WScript.Echo Arg1

Set objWMIService = GetObject("winmgmts:")
'Const IP = "192.168.1.56"
'Set IP = Wscript.Arguments.Named("ip")

Set objNewPort = objWMIService.Get _
    ("Win32_TCPIPPrinterPort").SpawnInstance_
objNewPort.Name = "IP_"&IP
objNewPort.HostAddress = IP

' Protocol: 0 = raw, 1 lpr => non 1 = raw, & 2 = lpr
if proto = 1 then
'WScript.echo "proto is 0"
        objNewPort.Protocol = 1
'       objNewPort.PortNumber = "9100"
        objNewPort.PortNumber = extra
else
'WScript.echo "proto is 1"
        objNewPort.Protocol = 2
        objNewPort.Queue = "directe"
end if
objNewPort.SNMPEnabled = False

'WScript.echo objNewPort.Name
'WScript.echo objNewPort.PortNumber
'WScript.echo objNewPort.Protocol

objNewPort.Put_
===

so my unattended script is like:

%Z%\scripts\tj\AddPrinterTcpIPport.vbs 192.168.x.x 1 9100
rundll32 printui.dll,PrintUIEntry /b "netbios-printer-name" /if /f
%windir%\inf\ntprint.inf /r "IP_192.168.x.x" /m
"windows-driver-name-in-.inf"



-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
unattended-info mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unattended-info

Reply via email to