#74018 - 2003-03-13 04:53 PM
Map Printer - Best solution?
|
Mabraham-ca
Fresh Scripter
Registered: 2003-02-17
Posts: 30
Loc: Toronto
|
Friends, I would like to map printers according to groups and setup one of the printer as default printer. Groups may have more than one printers and most of the clients are in Windows 95, 98, NT 2000. What are the best way to do this. I thought to use the following script, however, I have couple of doubts about that. Question: 1. How the drivers loaded to the workstation with the following script? 2. What will happen if printer is already configured for the workstation? - (specially if the user logon top the same workstation second time) 3. What is the benefit if I use the .ini file with this script, is windows 95/98 able to recognize the .ini file? Thanks. Mathew
Code:
IF INGROUP('Group_A') $rc=ADDPRINTERCONNECTION('\\MYT-1001\HP-Sales-001') ENDIF
|
|
Top
|
|
|
|
#74020 - 2003-03-13 06:01 PM
Re: Map Printer - Best solution?
|
Mabraham-ca
Fresh Scripter
Registered: 2003-02-17
Posts: 30
Loc: Toronto
|
Thanks For the info. I have noticed ADDPRINTERCONNECTION ("printer name")This function is available only on Windows NT and up, is there is any other command I can use for windows 95 for adding printers.
thanks
|
|
Top
|
|
|
|
#74023 - 2003-03-13 06:45 PM
Re: Map Printer - Best solution?
|
Mabraham-ca
Fresh Scripter
Registered: 2003-02-17
Posts: 30
Loc: Toronto
|
So there is no script solutions to map the Printers for W95/98?
What is IIRC I could not see any information on this in the Microsoft site.
Thanks. Mathew
|
|
Top
|
|
|
|
#74026 - 2003-03-13 08:21 PM
Re: Map Printer - Best solution?
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Sorry to barge in here..
What about -
Add Printer on 9x clients!
Does this help?
Kent
|
|
Top
|
|
|
|
#74028 - 2003-03-13 08:33 PM
Re: Map Printer - Best solution?
|
Chris S.
MM club member
   
Registered: 2002-03-18
Posts: 2368
Loc: Earth
|
What about AddPrinterConnection Method? It only requires Wsh 1.0 to run.
|
|
Top
|
|
|
|
#74030 - 2003-03-13 09:57 PM
Re: Map Printer - Best solution?
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Hmmm.. Yes, your correct Lonkero, but it does say that this one supports Win 9x
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthaddwindowsprinterconnection.asp
BUT The printer driver MUST already be installed.
Windows 9x/Me: object.AddWindowsPrinterConnection( strPrinterPath, strDriverName[,strPort] )
Remarks Using this method is similar to using the Printer option on Control Panel to add a printer connection. Unlike the AddPrinterConnection method, this method allows you to create a printer connection without directing it to a specific port, such as LPT1. If the connection fails, an error is thrown. In Windows 9x/Me, the printer driver must already be installed on the machine for the AddWindowsPrinterConnection method to work. If the driver is not installed, Windows returns an error message. [ 13. March 2003, 21:58: Message edited by: NTDOC ]
|
|
Top
|
|
|
|
#74034 - 2003-03-13 10:59 PM
Re: Map Printer - Best solution?
|
Mabraham-ca
Fresh Scripter
Registered: 2003-02-17
Posts: 30
Loc: Toronto
|
Thanks a lot - I really appriciate all of your help.
I am dropping the plan for mapping the printers for w95/98. However, I would like to know get some feedback from you guys for the following script. Specially I need to know if I need to delete the printer mapping before it map for Windows NT and up , I do not know how to delete the printer so please let me know the commands for that.
; Print Mapping IF InGroup("Sales") $null=AddPrinterConnection("\\myt-1001\HP-sales") ;$null=AddPrinterConnection("\\myt-1001\HP-sales-01") ;$null=SetDefaultPrinter("\\myt-1001\HP-sales") ? "Added printer connection.........." ENDIF -------------------------- Original Script:--------------------- md "\\myt-1001\home\@userid" USE p: /DELETE USE p: "\\myt-1001\@USERID$"
IF @inwin GOSUB nt ELSE GOSUB win95 ENDIF :end ? "script completed" EXIT
:nt IF %type% = "server" RETURN ENDIF
IF RedirectOutput("\\Myt-1001\Users\LoginLogs\@WKSTA.log", 1) = 0 ? "Opened '\\myt-1001\Users\LoginLogs\@WKSTA.log' "+@time ENDIF
? "ERRORS ARE " +@error " WHICH MEANS " + @serror ? ; Print Mapping IF InGroup("Sales") $null=AddPrinterConnection("\\myt-1001\HP-sales") ;$null=AddPrinterConnection("\\myt-1001\HP-sales-01") ;$null=SetDefaultPrinter("\\myt-1001\HP-sales") ? "Added printer connection.........." ENDIF
IF InGroup("Marketing") $null=AddPrinterConnection("\\myt-1001\HP-marketing") ;$null=AddPrinterConnection("\\myt-1001\HP-marketing-01") ;$null=SetDefaultPrinter("\\myt-1001\HP-marketing") ? "Added printer connection.........." ENDIF
IF InGroup("Sales") USE N: /delete /persistent USE N: "\\myt-1001\Sales" ENDIF
IF InGroup("Marketing") USE Y: /delete /persistent USE Y: "\\myt-1001\marketing" ENDIF RETURN ; Windows 95 Share Mapping
:win95 IF INGROUP ("myt\sales") ;$t = "Connecting drive I:" GOSUB text USE i: /DELETE USE i: "\\myt-1001\sales" ENDIF ;IF RedirectOutput("\\MYT-1001\Users\LoginLogs\@WKSTA.log", 1) = 0 ;? "Opened '\\Gfclnt03\Users\LoginLogs\@WKSTA.log' "+@time ;ENDIF
;? "ERRORS ARE " +@error " WHICH MEANS " + @serror ;?
IF INGROUP ("myt\marketing") ;$t = "Connecting drive I:" GOSUB text USE i: /DELETE USE i: "\\myt-1001\marketing"
GOSUB debug RETURN
|
|
Top
|
|
|
|
#74037 - 2003-03-14 12:51 AM
Re: Map Printer - Best solution?
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
Hate to beat this dead horse more Lonkero, but if you go read about con2prnt you will see it is designed for CONNECTING NT systems to network printers, not for installing drivers for Win9x
There is another utility with more enhanced abilities, but it too requires that the DRIVER ALREADY be installed for Win9x
http://www.jsiinc.com/SUBM/tip6000/rh6065.htm
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1452 anonymous users online.
|
|
|