[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Logon script

Posted on 2003-11-07
7
Medium Priority
?
6,488 Views
Last Modified: 2009-01-27
Hi

I have created a simple batch file so when the user logs on the network drives get mapped on there machine, however I also want the network printer to be installed on the users machine when they logon as well.  I have seen the command net use lpt1: //servername/sharename, however this will not work in my batch file as the printer is on a ip address.  Anyone have any ideas?

Thanks
Gareth
0
Comment
Question by:garethcummings
7 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 9700308
Install the printer on a server and share it. Then use con2prt.exe (from the NT Zero Administration Kit, still working fine in W2k/XP) to map the printer in the logon script.

Zero Administration Kit
http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTZAK.asp

To map a network printer:
con2prt.exe /c \\PrintServer\PrintShare
("/cd \\printserver\share" to install it as default printer; /f to delete all existing connections)

How to Use Con2prt.exe to Connect to a Network Printer
http://support.microsoft.com/?kbid=181663
0
 
LVL 2

Expert Comment

by:makerd
ID: 9701587
if it is a static IP address cannot you just swap the \\servername for \\ipaddress (obviously enter the ip eg: 10.34.8.80)
0
 
LVL 2

Expert Comment

by:makerd
ID: 9701592
sorry ignore my comment
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 2

Accepted Solution

by:
biggy_b earned 180 total points
ID: 9703193
This is what i use for a loginscript.
**************************************

net time \\server /set /yes                 ; sets client time to servers time

net use L: /d /y                       ;deletes old drive letters
net use M: /d /y
net use O: /d /y

net use L: \\server\Company\dep /y             ;add new drives
net use M: \\server\Company\apps /y
net use O: \\server\Company\org /y

RUNDLL32 PRINTUI.DLL,PrintUIEntry /dn /n\\server\printersharename    ;deletes windows printer
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n\\server\printersharename      ;adds windows printer

**********************************

I was never successfull at getting

net use lpt1: /delete /y
net use lpt1: \\server\printershare /y

to work for me. Ohh well hope that helps


0
 
LVL 4

Expert Comment

by:darth_wannabe
ID: 9704491
Are you running Active Directory? Can't you do this with a policy?
0
 
LVL 5

Expert Comment

by:snowsurfer
ID: 9706039
Use kixtart scripts.  They are a little scary at first, but theu work sweet
http://www.kixtart.org/

You can download it for free
0
 

Author Comment

by:garethcummings
ID: 9721043
Thanks biggy_b, that worked fine for me.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Exchange administrators are always vigilant about Exchange crashes and disasters that are possible any time. It is quite essential to identify the symptoms of a possible Exchange issue and be prepared with a proper recovery plan. There are multiple…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question