We’re running an old but critical DOS application on a Windows XP network. There is a label printer connected to the server that is accessed by networked computers. In order to do this, we’ve been using the following in a batch file: c:windowssystem32net use lpt1 \ServerLabel /y (The server is named Server and the printer is named Label).
We’ve now got a new Windows 7 machine that needs to access this printer, and apparently Net Use doesn’t work the way it used to. I’m a complete Win7 noob, but I understand that it’s possible. Does anyone have a clue what the syntax might be?
![]() |
Patch reliability is unclear, but widespread attacks make patching prudent. Go ahead and patch, but watch out for potential problems. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
Windows 7 and Net Use syntax
Home » Forums » AskWoody support » Windows » Windows 7 » Questions: Windows 7 » Windows 7 and Net Use syntax
- This topic has 20 replies, 7 voices, and was last updated 14 years, 11 months ago.
AuthorTopicWSKeith
AskWoody LoungerJuly 9, 2010 at 9:15 am #470183Viewing 17 reply threadsAuthorReplies-
WSmercyh
AskWoody LoungerJuly 9, 2010 at 9:23 am #1233280I don’t think the net use command is the issue. Do you have a PHYSICAL lpt1 port on this machine? if so you may have to disable it in device manager. As a test, does net use lpt2 or lpt3 work?
see the following thread
-
browni
AskWoody MVP -
joep517
AskWoody MVP -
WSKeith
AskWoody LoungerJuly 9, 2010 at 10:54 am #1233298The server is running Windows Server 2003. Currently there’s only about 8 active connections. That shouldn’t be a problem anyway, because the Windows 7 machine is a direct swap for the XP box we took out.
Based on the link mercyh posted, I’ve revised the batch file to this: c:windowssystem32net use lpt1 \Serverlabel password /USER:workgroupusername
I’m getting a ‘System error 5 access denied’ message. Hey, that’s progress, right?
By the way, I can’t disable LPT1. There’s a necessary local printer there. This whole schmear used to work fine with the XP computer. Dang. -
WSmercyh
AskWoody LoungerJuly 9, 2010 at 11:41 am #1233305Can you test the syntax by using LPT2 ? This would ensure that the used LPT1 is not part of the problem.
Any special characters in that password? sometimes special characters are not passed correctly from the command line.
also I think the syntax is:
Code:net use lpt1 \Serverlabel /USER:workgroupusername "password"
instead of
Code:net use lpt1 \Serverlabel password /USER:workgroupusername
-
WSmercyh
AskWoody LoungerJuly 9, 2010 at 11:46 am #1233308If you just do:
net use lpt1 \Serverlabel /USER:workgroupusername
does it prompt for your password? and does it work when you input the password manually?
Be aware that if you get it to work once it will not work the second time until you disconnect it as you will already have a share mapped from that workstation to the server with that account.
-
WSKeith
AskWoody LoungerJuly 9, 2010 at 12:34 pm #1233321Okay. I tried LPT2. That wouldn’t work. It couldn’t find the network connection.The
I tried it without the password and it DID prompt for the password. Strangely, it wouldn’t let me type anything in. At all. I finally hit ENTER and got an invalid password msg. The password is a 5-digit number – nothing fancy.
????? -
Paul T
AskWoody MVP -
WSKeith
AskWoody Lounger -
WSmercyh
AskWoody Lounger -
WSKeith
AskWoody Lounger -
WSjockmullin
AskWoody LoungerJuly 10, 2010 at 10:25 am #1233502It sounds like you are almost there, but I suspect the sharing violation is due to the local lpt1 port – it is in use for the local printer.
To test that, try disabling the lpt1 port temporarily in the bios, or change it to lpt2. If that solves the problem then configure the local printer to lpt2.
If all else fails, implement XP mode on the Win 7 machine and install your legacy app there. Do the net use in the XP machine and publish the app to the Win7 desktop.
Jock
-
WSKeith
AskWoody LoungerJuly 12, 2010 at 10:54 am #1233723AHA! I believe I’ve at least isolated the problem. Typing NET USER at a command prompt shows that this ONE guy has a two word user name (Joe Smith). Everyone else is just Mary or Tom. I can’t make two names in the batch file work, but without them, the user is not recognized. Is there a way to fix this – either at the server or in the batch file?
-
WSripley
AskWoody LoungerJuly 12, 2010 at 11:17 am #1233725AHA! I believe I’ve at least isolated the problem. Typing NET USER at a command prompt shows that this ONE guy has a two word user name (Joe Smith). Everyone else is just Mary or Tom. I can’t make two names in the batch file work, but without them, the user is not recognized. Is there a way to fix this – either at the server or in the batch file?
Did you try “Joe Smith” including the parentheses?
-
-
joep517
AskWoody MVP -
WSripley
AskWoody Lounger
-
-
WSmercyh
AskWoody LoungerJuly 12, 2010 at 11:24 am #1233727to test if this is really the problem, try mapping it with Mary or Tom. I can think of two workarounds if the
Parenthesisquotation trick doesn’t work.1> change his user name to be a single word. (may have profile issues on the machine)
2> create a new user just for mapping this printer and use the new user’s creds. (may be a problem 2 years down the road when you change something and don’t remember what you did to get it working.) -
WSKeith
AskWoody LoungerJuly 12, 2010 at 12:14 pm #1233731Ripley – thanks. I should have mentioned that I tried the quotes. I get “The user context supplied is invalid”, even though it works fine with the NET USER command at the DOS prompt.
Mercyh – First, I did try that third suggestion that you mentioned on Friday. No go. As to the name change, When I check it on the Server, the Login Name is just the first name. Yet, the NET USER command only recognizes the full name in quotes. ??? I’m not familiar enough with Server 2003 to know what to change to accomplish what I need to (with the least amount of damage).
-
WSmercyh
AskWoody Lounger -
WSKeith
AskWoody LoungerJuly 13, 2010 at 7:42 am #1233808Mercyh – Well, at least I’m pretty sure I know what the problem IS now, anyway – the server not accepting the login name. I’ll figure it out. You helped me get through the syntax and to eliminate some things it wasn’t. That’s huge. Thanks for sticking with this. Thanks to everyone who replied.
Viewing 17 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
AnduinOS (Windows 11 look alike)
by
Alex5723
17 minutes ago -
Total Commander updates
by
Alex5723
29 minutes ago -
Have you checked your FICO score?
by
Susan Bradley
1 hour ago -
Chrome ‘Scream to Unlock’ : Scream louder to get more time on Social Media
by
Alex5723
2 hours, 25 minutes ago -
Taskbar icon size
by
CWBillow
6 hours, 19 minutes ago -
Is it Local or is it Microsoft Account?
by
RetiredGeek
1 hour, 43 minutes ago -
Does Your State Reveal Who’s Been Hacked?
by
Nibbled To Death By Ducks
21 hours, 55 minutes ago -
A one-year extension to Windows 10 — almost free!
by
Susan Bradley
3 hours, 1 minute ago -
Windows Configuration Update (KB5062324) – June 2025
by
Alex5723
9 hours, 18 minutes ago -
A federal judge sides with Anthropic in lawsuit over training AI
by
Alex5723
1 day, 2 hours ago -
Name of MS Word Formatting Feature
by
John Baum
15 hours, 35 minutes ago -
InControl Failure?
by
Casey H
13 hours, 57 minutes ago -
Microsoft : Free 1 year support for Windows 10 after EOL
by
Alex5723
15 hours, 40 minutes ago -
MS-DEFCON 3: Businesses must tread carefully
by
Susan Bradley
7 hours, 23 minutes ago -
McLaren Health Care says data breach impacts 743,000 patients
by
Nibbled To Death By Ducks
2 days, 1 hour ago -
WhatsApp banned on House staffers’ devices
by
Alex5723
1 day, 20 hours ago -
Is your device eligible?
by
Susan Bradley
2 days, 4 hours ago -
Windows 11 Insider Preview build 26200.5661 released to DEV
by
joep517
2 days, 10 hours ago -
Windows 11 Insider Preview build 26120.4452 (24H2) released to BETA
by
joep517
2 days, 11 hours ago -
Hello Windows…My Problem is Windows Hello…
by
rdleib
2 days, 12 hours ago -
New Canon Printer Wants Data Sent
by
Win7and10
2 days, 12 hours ago -
I set up passkeys for my Microsoft account
by
Lance Whitney
1 hour, 49 minutes ago -
AI is for everyone
by
Peter Deegan
2 days, 12 hours ago -
Terabyte update 2025
by
Will Fastie
2 days, 6 hours ago -
Migrating from Windows 10 to Windows 11
by
Susan Bradley
13 hours, 25 minutes ago -
Lost sound after the upgrade to 24H2?
by
Susan Bradley
1 day, 6 hours ago -
How to move 10GB of data in C:\ProgramData\Package Cache ?
by
Alex5723
1 day, 14 hours ago -
Plugged in 24-7
by
CWBillow
2 days, 21 hours ago -
Netflix, Apple, BofA websites hijacked with fake help-desk numbers
by
Nibbled To Death By Ducks
4 days ago -
Have Copilot there but not taking over the screen in Word
by
CWBillow
3 days, 21 hours ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.