Drive: Cmd Command To Map Network

net use The output will list drive letters, UNC paths, and status (OK, Disconnected, etc.).

net use * /delete You will be prompted: You have these remote connections: ... Continue with operation? (Y/N) . To suppress the prompt, pipe Y or use echo : cmd command to map network drive

net use Z: \\Server01\Projects If the command succeeds, you will see: The command completed successfully. You can now open Z: in File Explorer. Sometimes you only need to access a share without cluttering your drive list. You can create a connection without a letter: net use The output will list drive letters,

New-PSDrive -Name "Z" -PSProvider FileSystem -Root "\\Server01\Projects" -Persist The -Persist switch is equivalent to /persistent:yes in CMD. PowerShell also allows mapping using different credentials: and status (OK