Map Drive Command Line Repack May 2026

PUSHD \\fileserver01\Marketing This automatically creates a temporary mapping, switches to it, and stores the previous location on a stack.

NET USE Z: \\fileserver01\Marketing This maps the Marketing share to the Z: drive. If the share requires authentication, you'll be prompted for credentials. Map with explicit credentials: map drive command line

New-PSDrive -Name Z -PSProvider FileSystem -Root \\server\share -Persist The command line's drive mapping tools— NET USE and PUSHD —are not relics. They are precision instruments for administrators, developers, and power users who need speed, repeatability, and control. Whether you're automating a backup routine, deploying a login script across hundreds of machines, or just want to map a drive faster than clicking through dialogs, the command line gets the job done. NET USE Z: /DELETE Delete all mappings at

NET USE Z: /DELETE Delete all mappings at once: and power users who need speed

NET USE Delete a mapping:

NET USE Z: \\fileserver01\Marketing /SAVECRED This stores credentials in Windows Credential Manager, allowing seamless reconnection later. List all current mappings:

×

Cookies settings and your privacy

We use cookies on our website. Some of them are necessary for the website to work, others help us improve it. Here you can choose cookie settings.

You can find more information here

Only necessary
Custom settings
Allow all cookies