![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnAlivnRP1Mo01XCawE8HX3kP3V-NM_gr7_570g8B4i0fX4bS3zb2EKDasrHZe9Ef9VBAWucafz7kOJigCPlDcNWkjyWCfny5AyinjfNzMgK5bMg3Zg-YiTZDFsEaGFDHPPv-Tu51Nh8k/s1600/windows-cli-150x150.png)
If you need to mount or unmount ('map' or 'disconnect' in Windows lingo) a Windows (Samba) share from Windows command line or batch file, you can do it with 'net use' command.
To map a network drive:
- Click Start, and then click Run (or use Windows+R keyboard shortcut).
- In the Open box, type cmd to open command line window.
- Type the following, replacing X: with drive letter you want to assign to the shared resource:
net use X: \\computer_name\share_name
- Open command line window.
- Type the following, replacing X: with drive letter of the shared resource:
net use X: /delete