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. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
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
-
Does windows update component store “self heal”?
by
Mike Cross
1 hour, 9 minutes ago -
Windows 11 Insider Preview build 27858 released to Canary
by
joep517
2 hours, 10 minutes ago -
Pwn2Own Berlin 2025: Day One Results
by
Alex5723
1 hour, 35 minutes ago -
Windows 10 might repeatedly display the BitLocker recovery screen at startup
by
Susan Bradley
2 hours, 16 minutes ago -
Windows 11 Insider Preview Build 22631.5409 (23H2) released to Release Preview
by
joep517
4 hours, 51 minutes ago -
Windows 10 Build 19045.5912 (22H2) to Release Preview Channel
by
joep517
4 hours, 53 minutes ago -
Kevin Beaumont on Microsoft Recall
by
Susan Bradley
11 hours, 54 minutes ago -
The Surface Laptop Studio 2 is no longer being manufactured
by
Alex5723
13 hours ago -
0Patch, where to begin
by
cassel23
7 hours, 2 minutes ago -
CFPB Quietly Kills Rule to Shield Americans From Data Brokers
by
Alex5723
1 day, 2 hours ago -
89 million Steam account details just got leaked,
by
Alex5723
14 hours, 24 minutes ago -
KB5058405: Linux – Windows dual boot SBAT bug, resolved with May 2025 update
by
Alex5723
1 day, 11 hours ago -
A Validation (were one needed) of Prudent Patching
by
Nibbled To Death By Ducks
1 day, 2 hours ago -
Master Patch Listing for May 13, 2025
by
Susan Bradley
13 hours, 17 minutes ago -
Installer program can’t read my registry
by
Peobody
8 hours, 15 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
23 hours, 57 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
1 day, 7 hours ago -
False error message from eMClient
by
WSSebastian42
1 day, 22 hours ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
2 days, 7 hours ago -
Office 2021 Perpetual for Mac
by
rebop2020
2 days, 8 hours ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
1 day, 5 hours ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
2 days, 12 hours ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
1 day, 13 hours ago -
Outdated Laptop
by
jdamkeene
2 days, 17 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
2 days, 22 hours ago -
Another big Microsoft layoff
by
Charlie
2 days, 22 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
46 minutes ago -
May 2025 updates are out
by
Susan Bradley
2 hours, 28 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
3 days, 4 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
3 days, 4 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.