How To Mount A Disk From The Command Line

Table of contents:

How To Mount A Disk From The Command Line
How To Mount A Disk From The Command Line

Video: How To Mount A Disk From The Command Line

Video: How To Mount A Disk From The Command Line
Video: LCL 15 - mounting and unmounting disks/partitions - Linux Command Line tutorial for forensics 2024, December
Anonim

Sometimes it becomes necessary to carry out certain actions in a modern operating system without using the capabilities provided by the graphical interface. In Windows, there is a command line interface emulator for this, through which you can, for example, connect a network resource using the special DOS command net use.

How to mount a disk from the command line
How to mount a disk from the command line

Instructions

Step 1

Start by opening a command prompt terminal - first press the win key and choose Run from the menu. If your OS version does not have this item in the main menu, then use the hotkeys win + r. Then type three letters cmd and press enter.

Step 2

Use the net use command to map a network drive. In this command, you must specify the letter that should be assigned to the mapped network drive, the network name of the computer on which this drive (folder, drive, etc.) is physically located, and the name of the network resource assigned on that computer to the mapped drive. For example, to connect a folder with a network name sharedDocs, which is located on the hard disk of a computer named mainComp on the network, and assign the letter G to this network drive, the command should be written like this: net use g: / mainCompsharedDocs. Instead of a computer name, you can use its IP address. For example: net use g: / 192.168.0.1sharedDocs. After entering, press enter and the network drive will be mapped.

Step 3

Specify the username and password assigned to it in the same command if it is required to connect to a network resource. For example, if for the example shown in the previous step the connection to the network computer mainComp requires the password myPass and it is assigned to the user myName, then the command must be supplemented with the u key indicating this data: net use g: / mainCompsharedDocs / u: myName "myPass".

Step 4

Add the persistent key with the value yes if the network drive connection created by the net use command needs to be automatically restored after the next boot of the computer. For example, the sample from the second step in this case should look like this: net use g: / mainCompsharedDocs / persistent: yes.

Step 5

Use the delete key if you need to disconnect a network drive. For example, the command net use g: / delete will disconnect drive G. To disconnect all network drives at once, use an asterisk instead of the letter: net use * / delete.

Recommended: