0

How can I connect to an already mapped network drive on the command line (i.e. without using File Explorer)?

I'd like to be able to run something like

C:\Users\ZaneDufour> some_command "D"
C:\Users\ZaneDufour> D:
D:\>

Whereas, at the moment, I have to open up File explorer and type S:\ into the command line.

(The idea with this is that I would like to be able to create a script that runs on startup to ping my network drive, so that I can use my text editor to open up files on the network drive without having to open file explorer first.)

Thanks a ton, and sorry if I missed a similar question that was already answered. It's hard to search through all of the questions about more common network drive issues.

1

There's the net use command. Here's the syntax:

C:\WINDOWS\system32>net use /?
The syntax of this command is:

NET USE
[devicename | *] [\\computername\sharename[\volume] [password | *]]
        [/USER:[domainname\]username]
        [/USER:[dotted domain name\]username]
        [/USER:[username@dotted domain name]
        [/SMARTCARD]
        [/SAVECRED]
        [[/DELETE] | [/PERSISTENT:{YES | NO}]]

NET USE {devicename | *} [password | *] /HOME

NET USE [/PERSISTENT:{YES | NO}]

Adding an example, as suggested:

Assuming that you want to map a drive on a computer named "SERVER01" that shares it's C: drive as "DRIVEC" and you want to access it as drive F:

net use F: \\SERVER01\DRIVEC

  • @LPChip thanks, I should have remembered to have done that. – Bill Hileman Jun 5 '18 at 20:26
  • Voted up. :) good answer. – LPChip Jun 5 '18 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.