Access a networked C drive through Command Prompt with net use and file sharing
To access another computer's C drive from Command Prompt, you need three things: the other computer's IP address or hostname, a username and password with permission on that machine, and file sharing enabled on both computers. The fastest method is the net use command, which maps a network drive to a letter on your own machine. Once mapped, you can browse and copy files as if the remote drive were physically attached to your computer.
This works only on a local network — both computers must be connected to the same network, and the remote computer must have file sharing turned on. You cannot use this method to access a computer on the internet or one that is powered off. If the computers are in different networks or separated by a firewall, you will need a remote desktop tool instead.
Key Takeaways
- The net use command maps a remote C drive to a letter on your computer, letting you access it like a local drive.
- You need the remote computer's IP address or hostname, plus a valid username and password for that machine.
- File sharing must be enabled on the remote computer, and both machines must be on the same network.
- After mapping, you can navigate to the drive in File Explorer or use dir and copy commands in Command Prompt.
- If net use fails, check that the remote computer is powered on, file sharing is enabled, and the username and password are correct.
Find the remote computer's IP address or hostname
Before you can connect, you need to identify the computer you want to access. You can use either its IP address (four numbers separated by dots, like 192.168.1.100) or its hostname (the name it was given on the network). The hostname is usually easier to remember and works as long as both computers are on the same local network.
To find the hostname of the remote computer, open Command Prompt on that machine and type hostname, then press Enter. The name will appear on the next line. If you need the IP address instead, type ipconfig and look for the line labeled "IPv4 Address" under your network adapter. Write down whichever one you plan to use.
Enable file sharing on the remote computer
The computer whose C drive you want to access must have file sharing turned on. On Windows 10 or 11, open Settings, go to System, then select Sharing options. Turn on Network discovery and File and printer sharing. If you are on Windows 7 or earlier, open the Network and Sharing Center from the Control Panel and click "Change advanced sharing settings," then enable file sharing for your network type.
You also need to share the C drive itself or a folder within it. Right-click the C drive (or a folder), select Properties, go to the Sharing tab, and click Share. Add the user account you plan to log in with and give it Read or Read/Write permission depending on what you need to do. If you are unsure of the username, ask the person who uses that computer or check the account name in Settings under Accounts.
Map the drive using net use in Command Prompt
Open Command Prompt on your own computer. Press the Windows key, type cmd, and press Enter. At the prompt, type the following command, replacing the bracketed parts with your actual information:
net use Z: \\hostname\c$ /user:username password
Replace Z: with any unused drive letter (X, Y, or Z are common choices). Replace hostname with the remote computer's name or IP address. Replace username with the account name on the remote computer, and password with that account's password. The c$ part tells the system you want the C drive; the dollar sign is required for system drives.
Press Enter. If the command succeeds, you will see "The command completed successfully." If it fails, you will see an error message. Common errors are "The specified computer is not accessible" (file sharing is off or the computer is offline), "Access denied" (wrong password or username), or "The network path was not found" (wrong hostname or IP address).
Browse and use the mapped drive
Once the drive is mapped, open File Explorer and look for the new drive letter in the left sidebar under "This PC." Click it to browse the remote C drive as if it were your own. You can open files, copy them to your computer, or create new folders — depending on the permission level you were given when the drive was shared.
You can also work with the mapped drive from Command Prompt itself. Type Z: (or whatever letter you chose) and press Enter to switch to that drive. Then use standard commands like dir to list files, copy to copy files, or cd to change directories. The mapped drive will stay connected until you restart your computer or manually disconnect it with the command net use Z: /delete.
Disconnect the mapped drive when you are done
To disconnect the mapped drive, open Command Prompt and type net use Z: /delete (replacing Z with your drive letter), then press Enter. You will see "The command completed successfully." The drive letter will no longer appear in File Explorer.
If you want the drive to stay mapped even after you restart your computer, add the /persistent:yes flag to your original net use command. This is useful if you access the same remote computer regularly. Without this flag, the mapping disappears when you restart.
Troubleshoot common connection problems
If net use returns "The specified computer is not accessible," first check that the remote computer is powered on and connected to the network. Ping it from Command Prompt by typing ping hostname or ping 192.168.1.100 (using the actual IP address). If you see "Reply from" messages, the computer is reachable. If you see "Request timed out," the computer is offline or not on your network.
If the computer is reachable but net use still fails, go back to the remote computer and verify that file sharing is enabled in Settings. Also check that the C drive or a parent folder is actually shared — right-click the C drive, select Properties, and look at the Sharing tab. If it says "Not shared," share it again and make sure the username you are using has permission.
If you get "Access denied," the username or password is wrong. Double-check both on the remote computer. Windows usernames are case-sensitive if the remote computer is part of a domain, so try typing the username exactly as it appears in Settings. If the remote computer has a blank password, you may need to type net use Z: \\hostname\c$ /user:username "" (with empty quotes for the password).
Frequently Asked Questions
Can I access a C drive on a computer outside my network?
No. The net use command only works on a local network where both computers can see each other directly. For remote access over the internet, use Remote Desktop (built into Windows Pro and higher) or a third-party tool like TeamViewer. These tools are more find for internet access because they encrypt the connection.
What if I do not know the password for the remote computer?
You cannot connect without a valid password. Ask the person who uses that computer for the password, or have them create a new account with a password you both know. If the remote computer has no password set, you may be able to use an empty password, but this is a security risk and not recommended.
Can I map a folder instead of the entire C drive?
Yes. Instead of \\hostname\c$, use \\hostname\c$\foldername to map a specific folder. You can also share a folder directly without sharing the whole C drive, which is safer. Right-click the folder, select Share, and follow the same steps as sharing the C drive.
Will the mapped drive stay connected if I restart my computer?
No, unless you add /persistent:yes to your net use command. With this flag, Windows will automatically reconnect the drive every time you log in. Without it, the mapping disappears after a restart and you must run the net use command again.
What is the difference between c$ and c: in the net use command?
The c$ (with a dollar sign) refers to the C drive on the remote computer as a shared system resource. The c: (with a colon) refers to the C drive on your own computer. Always use c$ when accessing a remote drive and c: when referring to your local drive.