logon script to add network printers

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hey guys,

this is a logon script i have implemented in one of our windows 2000 server
networks with all workstations windows 2000 professional with SP4. the script
has worked well with us, now we need to add few printers shared on the
network. can someone help me out here on how do i go about from here?


@echo off
REM filename: logon.cmd
echo Hello %username%
echo You are now logged into %computername%
echo Now setting up your computer for network access.
echo Connecting Network Drive
net use t: /DELETE
net use t: \\san01\bull /PERSISTENT:YES
echo Done.
echo Connecting Another Network Drive
net use r: /DELETE
net use r: \\san01\cow /PERSISTENT:YES
echo Done.

Thanks in advance
 
Your batch file is somewhat contradictory. On the one
hand you set /persistent:yes but on the other hand you
keep deleting remembered connections. If you make
your share connection in the logon script then you do
NOT want Windows to remember old connections!

The two lines preceded by # need to be executed just
once on each PC although it won't hurt leaving them
there. Remove the leading hashes!

I copied the vbs script from another post and I haven't
tried it myself.

@echo off
echo Hello %username%
echo You are now logged into %computername%
echo Now setting up your computer for network access.
echo Connecting Network Drive
#net use /persistent:no
#net use * /del /yes
net use t: \\san01\bull
echo Done.
echo Connecting Another Network Drive
net use r: \\san01\cow
echo Done.
net use
c:\Tools\Printer.vbs


Printer.vbs
=======
on error resume next
Set WshNetwork = CreateObject("WScript.Network")
WshNetwork.AddWindowsPrinterConnection "\\printserver\printershare1"
WshNetwork.SetDefaultPrinter "\\printserver\printershare1"
Set WshNetwork = nothing
 
Back
Top