Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

batch file

Posted on 2006-07-11
Last Modified: 2010-04-13
how to write batch file to capture a printer on startup in windows 2000
Question by:lsbrown1
  • 4
  • 2
LVL 57

Accepted Solution

Pete Long earned 300 total points
ID: 17088622
you need a net use lpt command

net use lpt1 \\machinename\sharename /Y


net use lpt1 \\machinename\sharename\ /user:username password /Y


RUNDLL32 PRINTUI.DLL,PrintUIEntry /dn /n\\COMPUTERNAME\PRINTERNAME      // removes printer    
RUNDLL32 PRINTUI.DLL,PrintUIEntry /in /n\\COMPUTERNAME\PRINTERNAME       // adds printer

Zero Administration Kit

How to Use Con2prt.exe to Connect to a Network Printer
LVL 43

Expert Comment

by:Steve Knight
ID: 17088828
Maybe I am missing something here with the /Y but you should be able to just use /persistent:yes to make it come back after a reboot.  This is user based though so if you want it to happen for different users they will all need it setup.

net use lpt1 \\server\printershare /persistent:yes

Author Comment

ID: 17089545
this device will login to terminal service
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

LVL 57

Expert Comment

by:Pete Long
ID: 17093405

does the same as


m8 :)
LVL 43

Expert Comment

by:Steve Knight
ID: 17095001
[/Y]: Thought it probably did, always used the long way.
LVL 57

Expert Comment

by:Pete Long
ID: 17097421
:^)  np
LVL 57

Expert Comment

by:Pete Long
ID: 17121167

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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…
Most MSPs worth their salt are already offering cybersecurity to their customers. But cybersecurity as a service is wide encompassing and can mean many things.  So where are MSPs falling in this spectrum?
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

765 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