Below is an example in my environment:
****************************************************************************
If IsMember("GROUPNAME") Then                            
MapDrive "G:", "\\SERVER\SHARE$"    (I hide all my user shares)
MapDrive "P:", "\\SERVER\SHARE-2$"                     
gDrive ="G:\" 
pDrive ="P:\"
oShell.NameSpace(gDrive).Self.Name = " RENAME Share" (Rename the hidden share)
oShell.NameSpace(pDrive).Self.Name = "RENAME Share"
Prn.AddWindowsPrinterConnection "\\Server\PrinterName"  (Map the group to a network printer)
Prn.SetDefaultPrinter "\\Server\PrinterName"  (Set the default printer for a group/OU)
End If
**********************************************************************************************

Let me know if someone wants the full script.

-Z.V.

Active Directory wrote:
RE: [ActiveDir] Help with _vbscript_ to map printers

If you are using that exact script. Line eight asks for UNCpath3

Line 3 & 4 specify UNCpath2 change UNCpath2 on line 4 to UNCpath3

hth

Rick

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Noah Eiger
Sent: Wednesday, December 07, 2005 1:10 PM
To: [email protected]
Subject: [ActiveDir] Help with _vbscript_ to map printers

Hi –

I am trying to modify a VBS found on the Internet to map multiple printers. This will be run for every user in an OU. I keep getting the following error for line 8: 8007007B - The filename, directory name or volume syntax is incorrect

I have played around with the syntax but think I am missing something very basic here. Any thoughts?

I got this from: http://www.computerperformance.co.uk/ezine/ezine16.htm#Example%203:%20Mapping%20Multiple%20Printers

'  Poached from Guy Thomas February 2004.

'  ******************************

Dim multiPrinter, UNCpath1, UNCpath2, UNCpath3

UNCpath1 = "\\server.abc.private\HP Color LaserJet 3500"

UNCpath2 = "\\server.abc.private\HP LaserJet 3300"

UNCpath2 = "\\server.abc.private\HP LaserJet 5000"

Set multiPrinter = CreateObject("WScript.Network")

multiPrinter.AddWindowsPrinterConnection UNCpath1

multiPrinter.AddWindowsPrinterConnection UNCpath2

multiPrinter.AddWindowsPrinterConnection UNCpath3

'  WScript.Echo "Your printer is mapped from : " & UNCpath1  _

'  & "and from : " & UNCpath2

WScript.Quit

' End of _vbscript_

List info : http://www.activedir.org/List.aspx List FAQ : http://www.activedir.org/ListFAQ.aspx List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/

Reply via email to