Solved

Logon script

Posted on 2003-11-07
7
6,453 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 83

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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 2

Accepted Solution

by:
biggy_b earned 45 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

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…
What is Backup? Backup software creates one or more copies of the data on your digital devices in case your original data is lost or damaged. Different backup solutions protect different kinds of data and different combinations of devices. For e…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now