Automatically Map Network Drive Batch File

Create the file ( .bat ) and let NET pick a free drive letter, then use NET to find out what letter it assigned:

net use * “\\server\share”
for /f “tokens=2” %%i in (‘net use ^| find “\\server\share”‘) do set netdrive=%%i
echo %netdrive% has been mapped

This entry was posted in Windows. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *