Teachers
Others
Viewed Video Time
To disconnect and return to the original drive:
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: \\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:
NET USE Z: \\fileserver01\Marketing /USER:DOMAIN\jsmith P@ssw0rd Security note: Embedding passwords in plaintext is convenient for scripts but a security risk. Use * instead of the password to trigger a secure prompt.
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 /PERSISTENT:YES
NET USE Delete a mapping:
To disconnect and return to the original drive:
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: \\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:
NET USE Z: \\fileserver01\Marketing /USER:DOMAIN\jsmith P@ssw0rd Security note: Embedding passwords in plaintext is convenient for scripts but a security risk. Use * instead of the password to trigger a secure prompt.
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 /PERSISTENT:YES
NET USE Delete a mapping: