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?
![]() |
There are isolated problems with current patches, but they are well-known and documented on this site. |
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, 10 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
-
Office gets current release
by
Susan Bradley
10 minutes ago -
FBI: Still Using One of These Old Routers? It’s Vulnerable to Hackers
by
Alex5723
12 hours, 25 minutes ago -
Windows AI Local Only no NPU required!
by
RetiredGeek
25 minutes ago -
Stop the OneDrive defaults
by
CWBillow
13 hours, 14 minutes ago -
Windows 11 Insider Preview build 27868 released to Canary
by
joep517
23 hours, 10 minutes ago -
X Suspends Encrypted DMs
by
Alex5723
1 day, 1 hour ago -
WSJ : My Robot and Me AI generated movie
by
Alex5723
1 day, 1 hour ago -
Botnet hacks 9,000+ ASUS routers to add persistent SSH backdoor
by
Alex5723
1 day, 2 hours ago -
OpenAI model sabotages shutdown code
by
Cybertooth
1 day, 2 hours ago -
Backup and access old e-mails after company e-mail address is terminated
by
M W Leijendekker
15 hours, 4 minutes ago -
Enabling Secureboot
by
ITguy
22 hours, 3 minutes ago -
Windows hosting exposes additional bugs
by
Susan Bradley
1 day, 10 hours ago -
No more rounded corners??
by
CWBillow
1 day, 6 hours ago -
Android 15 and IPV6
by
Win7and10
20 hours, 22 minutes ago -
KB5058405 might fail to install with recovery error 0xc0000098 in ACPI.sys
by
Susan Bradley
1 day, 23 hours ago -
T-Mobile’s T-Life App has a “Screen Recording Tool” Turned on
by
Alex5723
2 days, 1 hour ago -
Windows 11 Insider Preview Build 26100.4202 (24H2) released to Release Preview
by
joep517
1 day, 20 hours ago -
Windows Update orchestration platform to update all software
by
Alex5723
2 days, 9 hours ago -
May preview updates
by
Susan Bradley
1 day, 20 hours ago -
Microsoft releases KB5061977 Windows 11 24H2, Server 2025 emergency out of band
by
Alex5723
1 day, 12 hours ago -
Just got this pop-up page while browsing
by
Alex5723
2 days, 1 hour ago -
KB5058379 / KB 5061768 Failures
by
crown
1 day, 22 hours ago -
Windows 10 23H2 Good to Update to ?
by
jkitc
1 day ago -
At last – installation of 24H2
by
Botswana12
3 days ago -
MS-DEFCON 4: As good as it gets
by
Susan Bradley
1 hour, 55 minutes ago -
RyTuneX optimize Windows 10/11 tool
by
Alex5723
3 days, 12 hours ago -
Can I just update from Win11 22H2 to 23H2?
by
Dave Easley
1 day, 11 hours ago -
Limited account permission error related to Windows Update
by
gtd12345
4 days, 2 hours ago -
Another test post
by
gtd12345
4 days, 2 hours ago -
Connect to someone else computer
by
wadeer
3 hours, 45 minutes 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.