#187932 - 2008-05-29 10:03 AM
AddPrinterConnection in Windows 2003
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
Hi All We have just moved from windows 2000 to a windows 2003 Server Everything work but my AddPrinterConnection in the script.
Does any one know how to fix this??
$Index=0 do $Group=enumgroup($index) if left($Group,7)="12345" ?$Group $A=MapDrive($Group) endif $Index=$Index+1 until LEN ($Group)=0
IF InGroup("12345\ZAF.DOMAINUSERS") SetDefaultPrinter ("\\PYE511\SHIP47") ENDIF
FUNCTION MapDrive($Group) SELECT CASE $Group="12345\ZAF.DOMAINUSERS" AddPrinterConnection ("\\PYE511\SHIP33") AddPrinterConnection ("\\PYE511\SHIP37") AddPrinterConnection ("\\PYE511\SHIP45") SetDefaultPrinter ("\\PYE511\SHIP33")
ENDSELECT ENDFUNCTION
This has work well for the last 4 years.
Thanks
|
|
Top
|
|
|
|
#187935 - 2008-05-29 11:10 AM
Re: AddPrinterConnection in Windows 2003
[Re: Mart]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
Ok So all I need to do is....
AddPrinterConnection ("\\PYE511\SHIP33")@error AddPrinterConnection ("\\PYE511\SHIP37")@error AddPrinterConnection ("\\PYE511\SHIP45")@error
Is this correct sorry I have not needed to script for some time now.
|
|
Top
|
|
|
|
#187937 - 2008-05-29 11:43 AM
Re: AddPrinterConnection in Windows 2003
[Re: Mart]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
Thanks for that
I got the following: 0 0 The operation completed successfully.0 0 The operation completed successfully.0 0 The operation completed successfully0
Correct me if I am wrong but this is ok?? !!
|
|
Top
|
|
|
|
#187938 - 2008-05-29 11:48 AM
Re: AddPrinterConnection in Windows 2003
[Re: REJ]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
Sorry The server was pionted to the backup server
the is the error I got
123 The filename, directory name, or Volume label syntax is incorrect. 123 123 The filename, directory name, or Volume label syntax is incorrect. 123 123 The filename, directory name, or Volume label syntax is incorrect. 123
Any ideas?
Sorry about that
|
|
Top
|
|
|
|
#187940 - 2008-05-29 12:30 PM
Re: AddPrinterConnection in Windows 2003
[Re: Mart]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
I get the same error 123 The filename, directory name, or Volume label syntax is incorrect. 123 123 The filename, directory name, or Volume label syntax is incorrect. 123 123 The filename, directory name, or Volume label syntax is incorrect. 123 123 The filename, directory name, or Volume label syntax is incorrect. 123
I have tried:
Debug on
If ADDPRINTERCONNECTION ("\\SHE500\SHIP47") = 0 ? "Added printer connection...." else ?@ERROR ?@SERROR Endif
AddPrinterConnection ("\\SHE500\SHIP33") ?@ERROR ?@SERROR Sleep 2
AddPrinterConnection ("\\SHE500\SHIP37") ?@ERROR ?@SERROR Sleep 2
AddPrinterConnection ("\\SHE500\SHIP45") ?@ERROR ?@SERROR Sleep 9
|
|
Top
|
|
|
|
#187942 - 2008-05-29 02:55 PM
Re: AddPrinterConnection in Windows 2003
[Re: Mart]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
If I run the script with out debug on I get a error 1801 in the return value if this helps
I have had a look at Win32 error codes and that does not refer to the error I am getting so I am a bit lost at the moment.
any ideas
the share name is the same so is the server the only thing that has changed is upgraded from win 2000 to 2003.
|
|
Top
|
|
|
|
#187946 - 2008-05-29 03:36 PM
Re: AddPrinterConnection in Windows 2003
[Re: Mart]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
I will break it down in to smaller bits and try it.
I can connect to them if I browse to the server and r-click, connect that works fine but not as a script using addprinterconnection.
|
|
Top
|
|
|
|
#187955 - 2008-05-29 05:43 PM
Re: AddPrinterConnection in Windows 2003
[Re: Richard H.]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
1.I checked the Nameing and it is all correct.
2.this is the event log error. Event ID: 20
Printer Driver Xerox WorkCentre Pro 55 PS for Windows NT x86 Version-3 was added or updated. Files:- PSCRIPT5.DLL, PS5UI.DLL, xw55pSd.ppd, PSCRIPT.HLP, PSCRIPT.NTF, xw55pSd.ini, xw55pSd.xpb, xwpuisd.dll, xwprensd.dll, xwprsd.dll, xxuisd.dll, xxpsrsd.dll, xxstrsd.dll, xxressd.dll, xxuiwpsd.dll, xxwmsd.dll, xwphlp4p.hlp, xw55pSd.cfg, xw55pSd.dyc, xw55p4q.chm, XSNMX.DLL, XBD32.DLL, XBASE.DLL, XBDSNMP.DLL, XV2P.DLL, XBDSTAT.EXE, XMODELS.DLL, XLndAlrt.dat, FFACT_LM.pdf, LPS_UGP.pdf, LPCL_UGP.pdf.
|
|
Top
|
|
|
|
#187956 - 2008-05-29 05:47 PM
Re: AddPrinterConnection in Windows 2003
[Re: REJ]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
All I have in my script is the following? I have tried Upper case and lower case and still no joy this does still not map any printer for me.
Debug On
If InGroup("INETPSA\ZAF.MIS") AddPrinterConnection ("\\she500\SHIP33") AddPrinterConnection ("\\she500\SHIP31") AddPrinterConnection ("\\she500\SHIP45") AddPrinterConnection ("\\SHE500\SHIP48") AddPrinterConnection ("\\SHE500\SHIP39") AddPrinterConnection ("\\SHE500\SHIP42") AddPrinterConnection ("\\SHE500\SHIP43") AddPrinterConnection ("\\SHE500\SHIP32") AddPrinterConnection ("\\SHE500\SHIP40") AddPrinterConnection ("\\SHE500\SHIP41") AddPrinterConnection ("\\SHE500\SHIP44") DelPrinterConnection ("\\SHE500\SHIP54") AddPrinterConnection ("\\SHE500\SHIP49") AddPrinterConnection ("\\SHE500\SHIP35") AddPrinterConnection ("\\SHE500\SHIP36") AddPrinterConnection ("\\SHE500\SHIP50") AddPrinterConnection ("\\SHE500\SHIP51") AddPrinterConnection ("\\SHE500\SHIP37") AddPrinterConnection ("\\SHE500\SHIP46") AddPrinterConnection ("\\SHE500\SHIP38") AddPrinterConnection ("\\SHE500\SHIP34") AddPrinterConnection ("\\SHE500\SHIP59") SetDefaultPrinter ("\\SHE500\SHIP47") EndIf
|
|
Top
|
|
|
|
#187959 - 2008-05-29 06:59 PM
Re: AddPrinterConnection in Windows 2003
[Re: REJ]
|
Destinova
Just in Town
Registered: 2008-05-15
Posts: 4
|
I am having the exact same issue and it's driving me nuts. The AddPrinterConnection line is giving me error 123. The share and printer name are identical (copied and pasted), and I can browse to the share and see the printer.
|
|
Top
|
|
|
|
#187973 - 2008-05-30 09:20 AM
Re: AddPrinterConnection in Windows 2003
[Re: Destinova]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
That good in one way at lease I am n ot the onlt one with the problem.
|
|
Top
|
|
|
|
#187982 - 2008-05-30 03:10 PM
Re: AddPrinterConnection in Windows 2003
[Re: Björn]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
I get a retuen of "in group"
so that is working is it not??
|
|
Top
|
|
|
|
#187983 - 2008-05-30 03:11 PM
Re: AddPrinterConnection in Windows 2003
[Re: REJ]
|
REJ
Fresh Scripter
Registered: 2008-05-29
Posts: 12
|
If I add the following:
If InGroup("INETPSA\ZAF.MIS") 'in group' ? AddPrinterConnection ("\\she500\SHIP33") AddPrinterConnection ("\\she500\SHIP31") EndIf
I get in group 123 123
What does 123 mean??
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 987 anonymous users online.
|
|
|