Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > maping network printer via script

maping network printer via script

Forum Windows XP : Windows XP General Discussion - maping network printer via script

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

 

I have read several contributions on topic maping network printers by
scripts. The only one problem remained. How to add the username/password
into such a script?
My network department has several computers and we don't use central
server services. The printer is shared via "microsoft files and
printers sharing". The host computer has Windows XP but unfortunatelly
there are some Windows 2000 clients. They can't login to the host at
startup and everyday connecting with login/password is annoying. Each
station user has different login/password which differs from login
password for sharing network resources on host computer. I don't want to
make so many user account on host computer. Then, Is it easier to make
connection from client stations with net use syntax or might I use the
scripting host language? Could you be so kind and help me with
incorporating username/password into script or net syntax?

I have already found one script. If it is suitable for my situation
please add the username/password section.
--------------
Script start ->

On Error Resume next

Set WshNetwork = Createobject ("wscript.network" )
Set WshShell = CreateObject("WScript.Shell" )

PC = UCase(WshShell.ExpandEnvironmentStrings("%computername%" ))

Select Case PC
Case "PRC1"
WshNetwork.addprinterconnection "lpt1", "\\printer1"
WScript.Echo "Mapped to printer printer1"
Case "PC2"
'Etc
End select

<- Script end
--------------------

Thanks in advance

Sponsored Links
Register or log in to remove.

Archived from groups: microsoft.public.windowsxp.print_fax (More info?)

 

See if Bruce Sanderson's article helps:
http://members.shaw.ca/bsanders/NetPrinterAllUsers.htm
--
Cari (MS-MVP Printing, Imaging & Hardware)
www.coribright.com

"Alan Gavel" <agavel@centrum.cz> wrote in message
news:urIAxxzjEHA.596@TK2MSFTNGP11.phx.gbl...
>I have read several contributions on topic maping network printers by
>scripts. The only one problem remained. How to add the username/password
>into such a script?
> My network department has several computers and we don't use central
> server services. The printer is shared via "microsoft files and printers
> sharing". The host computer has Windows XP but unfortunatelly there are
> some Windows 2000 clients. They can't login to the host at startup and
> everyday connecting with login/password is annoying. Each station user has
> different login/password which differs from login password for sharing
> network resources on host computer. I don't want to make so many user
> account on host computer. Then, Is it easier to make connection from
> client stations with net use syntax or might I use the scripting host
> language? Could you be so kind and help me with incorporating
> username/password into script or net syntax?
>
> I have already found one script. If it is suitable for my situation please
> add the username/password section.
> --------------
> Script start ->
>
> On Error Resume next
>
> Set WshNetwork = Createobject ("wscript.network" )
> Set WshShell = CreateObject("WScript.Shell" )
>
> PC = UCase(WshShell.ExpandEnvironmentStrings("%computername%" ))
>
> Select Case PC
> Case "PRC1"
> WshNetwork.addprinterconnection "lpt1", "\\printer1"
> WScript.Echo "Mapped to printer printer1"
> Case "PC2"
> 'Etc
> End select
>
> <- Script end
> --------------------
>
> Thanks in advance

Reply to Anonymous
Tom's Hardware > Forum > Windows XP > Windows XP General Discussion > maping network printer via script
Go to:

There are 868 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them