• Windows 7 and Net Use syntax

    Home » Forums » AskWoody support » Windows » Windows 7 » Questions: Windows 7 » Windows 7 and Net Use syntax

    Author
    Topic
    #470183

    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?

    Viewing 17 reply threads
    Author
    Replies
    • #1233280

      I 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

      http://social.technet.microsoft.com/Forums/en-US/w7itpronetworking/thread/b33638c8-1032-4775-82e2-21f457cd0b70

    • #1233281

      The syntax looks pretty similar apart from the /y directive.

      If you type in “net use /help” without quotes at a command prompt it will show you the syntax for the command.

    • #1233296

      What OS is “Server” running? How many active connections to Server?

      Joe

      --Joe

    • #1233298

      The 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.

    • #1233305

      Can 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
    • #1233308

      If 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.

    • #1233321

      Okay. 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.
      ?????

    • #1233327

      Just type the password and press Enter – it’s not meant to show any characters for security reasons.

      cheers, Paul

    • #1233334

      Thanks, Paul. Duh. Shoulda seen that. Even so, I still get a system error 5 – access denied. It IS the right name and password for that guy. Not sure what else to try, now. I hate to spend Friday this way.

    • #1233340

      Did you look into the third post on the link I gave above?

    • #1233349

      Thanks for getting back to me late on a Friday. I just got home so I don’t have access to the Win7 machine until Monday. I’ll try that first thing. You may have hit something. Thanks again. Have a great WE.

    • #1233502

      It 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

    • #1233723

      AHA! 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?

      • #1233725

        AHA! 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?

    • #1233726

      That would be including the quotation marks around the name not parenthises.

      Joe

      --Joe

      • #1233729

        That would be including the quotation marks around the name not parenthises.

        Joe

        Sorry, my bad English, quotation marks, of course.

    • #1233727

      to test if this is really the problem, try mapping it with Mary or Tom. I can think of two workarounds if the Parenthesis quotation 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.)

    • #1233731

      Ripley – 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).

    • #1233746

      I am about out of tricks…….

      sorry

    • #1233808

      Mercyh – 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
    Reply To: Windows 7 and Net Use syntax

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: