Net use command prompting for a username and password

Posted on 2005-04-07
Last Modified: 2012-05-05
We've got a dos based program that we use to print reports from.  The program prints to LPT1 and we've got an XP machine that we are using as a print server.  The same XP machine is also used by our shipping/receiving clerk.  She is a member of our domain and has to login in each morning with her username angela, password:*****.

When I use the net use command in dos to capture the printer port, it prompts me for a username and password.  Here, I have to enter username: angela and password:***** to be able to capture the printer port.

I'm using the /persistent:yes command which tells dos to keep this mapping even after rebooting which it does, but it's not keeping the username and password entries.

Is there another way to capture the printer port without having to enter a username and password or does anyone know how to write a batch file that I can run at startup to capture the printer port and enter the username and password automatically?

Thanks in advance for any help!!!
Question by:jeffmsas
    LVL 2

    Expert Comment

    try this

    net use whatever you use here /user:angela password

    Author Comment

    Doing something wrong.  I'm getting a system error 1326 (login failure: unknown username or bad password.  Here's what I'm using:

    net use lpt1: \\print_2\fujitsu /persistent:yes /user:angela password:angelaf

    Is this correct?
    LVL 2

    Accepted Solution

    sorry, where I had put password you just need to put the password in.  

    Author Comment

    Sweet.  That worked!!!  Thanks a ton for the help!!!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
    Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now