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, 9 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
-
Notice on termination of services of LG Mobile Phone Software Updates
by
Alex5723
6 hours, 58 minutes ago -
Update your Apple Devices Wormable Zero-Click Remote Code Execution in AirPlay..
by
Alex5723
3 hours ago -
Amazon denies it had plans to be clear about consumer tariff costs
by
Alex5723
9 hours, 24 minutes ago -
Return of the brain dead FF sidebar
by
EricB
1 minute ago -
windows settings managed by your organization
by
WSDavidO61
4 hours, 6 minutes ago -
Securing Laptop for Trustee Administrattor
by
PeachesP
4 hours, 19 minutes ago -
The local account tax
by
Susan Bradley
9 minutes ago -
Recall is back with KB5055627(OS Build 26100.3915) Preview
by
Alex5723
16 hours, 1 minute ago -
Digital TV Antenna Recommendation
by
Win7and10
8 hours, 33 minutes ago -
Server 2019 Domain Controllers broken by updates
by
MP Support
1 day, 3 hours ago -
Google won’t remove 3rd party cookies in Chrome as promised
by
Alex5723
1 day, 5 hours ago -
Microsoft Manager Says macOS Is Better Than Windows 11
by
Alex5723
1 day, 8 hours ago -
Outlook (NEW) Getting really Pushy
by
RetiredGeek
11 hours, 10 minutes ago -
Steps to take before updating to 24H2
by
Susan Bradley
1 hour, 59 minutes ago -
Which Web browser is the most secure for 2025?
by
B. Livingston
15 hours, 36 minutes ago -
Replacing Skype
by
Peter Deegan
4 hours, 9 minutes ago -
FileOptimizer — Over 90 tools working together to squish your files
by
Deanna McElveen
1 day, 2 hours ago -
Excel Macro — ask for filename to be saved
by
nhsj
6 minutes ago -
Trying to backup Win 10 computer to iCloud
by
SheltieMom
3 hours, 56 minutes ago -
Windows 11 Insider Preview build 26200.5570 released to DEV
by
joep517
3 days, 8 hours ago -
Windows 11 Insider Preview build 26120.3941 (24H2) released to BETA
by
joep517
3 days, 10 hours ago -
Windows 11 Insider Preview Build 22635.5305 (23H2) released to BETA
by
joep517
3 days, 10 hours ago -
No April cumulative update for Win 11 23H2?
by
Peobody
1 day, 22 hours ago -
AugLoop.All (TEST Augmentation Loop MSIT)
by
LarryK
3 days, 11 hours ago -
Boot Sequence for Dell Optiplex 7070 Tower
by
Serge Carniol
4 days, 2 hours ago -
OTT Upgrade Windows 11 to 24H2 on Unsupported Hardware
by
bbearren
4 days, 5 hours ago -
Inetpub can be tricked
by
Susan Bradley
2 days, 13 hours ago -
How merge Outlook 2016 .pst file w/into newly created Outlook 2024 install .pst?
by
Tex265
2 days, 23 hours ago -
FBI 2024 Internet Crime Report
by
Alex5723
4 days, 9 hours ago -
Perplexity CEO says its browser will track everything users do online
by
Alex5723
1 day, 18 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.