NET.exe Share

The NET Share command is used to manage file/printer shares as follows:

Display the details of a local share
NET SHARE sharename

Display the details of all local shares, including the folder/pathname that is being shared:
NET SHARE
To retrieve share details from a remote machine, use WMIC share

Create a new local file share
NET SHARE sharename=drive:path /REMARK:"text" [/CACHE:Manual | Automatic | No ]

Limit the number of users who can connect to a share
NET SHARE sharename /USERS:number /REMARK:"text"

Remove any limit on the number of users who can connect to a share
NET SHARE sharename /UNLIMITED /REMARK:"text"

Delete a share
NET SHARE {sharename | devicename | drive:path} /DELETE

Delete all shares that apply to a given device
NET SHARE devicename /DELETE
In this case the devicename can be a printer (Lpt1) or a pathname (C:\Docs\)

To create file shares, File and Printer sharing must be enabled on the (server) computer.

“Don’t worry about people stealing an idea. If it's original, you will have to ram it down their throats” ~ Howard Aiken

Related:

NET - Manage network resources.
NET USE - Connect to a file share (Drive MAP).
NET VIEW - View existing file/printer shares (local or remote).
fsmgmt.msc - Network share Admin snap-in.
Drmapsrv - Drive Share for use with Terminal Services (Win 2K Server Resource Kit only).
WMIC share - View remote file/print shares.
Q149427 - Change Password from the CMD prompt.
Powershell: Get-WmiObject win32_share


© Copyright SS64.com 1999-2016
Some rights reserved