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?
_usern
in the first line andusern
(no_
) in the second line.