2

I have a batch file that includes these lines:

set /p _usern=Username: 
net use g: \\servername\d$ /user:%usern%

If I run these commands directly from a command prompt window, the path is found and the appropriate error (username/password incorrect) is displayed, if necessary. The drive is otherwise mapped as expected.

If I run these same exact commands from a batch file, either normal or admin, I receive this error:

System error 53 has occurred. The network path was not found.

Why do these commands work from a command prompt window and not a batch file?

3
  • 5
    You have _usern in the first line and usern (no _) in the second line.
    – DavidPostill
    Oct 15, 2015 at 15:27
  • Wow, I'm an idiot, I knew it would be something simple. Thank you, I appreciate it.
    – vaindil
    Oct 15, 2015 at 15:28
  • No problem - we all make silly mistakes ;)
    – DavidPostill
    Oct 15, 2015 at 15:30

0

You must log in to answer this question.

Browse other questions tagged .