If you don't care which letter is used, use * to automatically assign the next available letter starting from the end of the alphabet (Z, Y, X, etc.). Example: net use * \\DataServer\Public
The * prompts for password (hidden input). Safer than typing password in plain text. cmd map network drive better
If you don't care which drive letter is used, use an asterisk ( ) to let Windows pick the first available letter. net use * \\Server\Share Connect with Different Credentials: If you don't care which letter is used,
By default, some CMD-mapped drives disappear after a reboot. Use the persistent switch to ensure it returns. net use Z: \\Server\Share /persistent:yes If you don't care which drive letter is
To delete a mapped network drive, use the following command:
if exist Z:\ ( echo Z: already mapped ) else ( net use Z: \\server\share /persistent:yes )
net use [drive letter] \\[server name]\[shared folder]