Map Network Drive Windows 11 Command Line [exclusive] May 2026

net use Z: /delete /y 1. Batch Script for Multiple Drives Create a .bat file with the following:

net use Z: \\fileserver\securefolder /user:DOMAIN\username * You will be prompted to enter the password (which remains hidden as you type). By default, mapped drives using net use are not persistent – they disappear after you log off. To make the drive reconnect automatically every time you sign in, use the /persistent:yes flag. map network drive windows 11 command line

net use Z: \\fileserver\shareddata /persistent:yes Alternatively, set persistence globally for all future mappings: net use Z: /delete /y 1

Once you've mastered these commands, consider creating batch scripts to run at login via Task Scheduler or placing them in the Startup folder ( shell:startup ) for seamless, automated drive connections every time you boot. To make the drive reconnect automatically every time

net use Z: \\server\share /user:WORKGROUP\AlternateUser Password123 /persistent:yes To avoid storing the password in plain text, use * to prompt interactively:

net use * \\server\share Windows will assign the next available drive letter automatically. To list all active network connections: