SHARE command in Windows
The Windows SHARE command allows users to easily share files and folders with other users on the network. By using this command, you can grant or revoke access to shared resources, set permissions, and manage shared resources efficiently. Share your files and folders seamlessly with others using the Windows SHARE command.
SHARE Syntax:
net share [sharename=drive:path] [/grant:user,[READ | CHANGE | FULL]] [/delete]
Windows SHARE Options:
Option | Description |
---|---|
sharename=drive:path | Specifies the name of the shared resource and the physical location of the resource to share. |
/grant:user ,[READ | CHANGE | FULL] | Grants specific permissions to a user for the shared resource. |
/delete | Deletes an existing share. |
SHARE Parameters:
Parameter | Description |
---|---|
sharename | Name of the shared resource and the path to the physical location. |
user | The user or group to which permissions are granted. |
READ | Grants read-only access to the shared resource. |
CHANGE | Grants read and write access to the shared resource. |
FULL | Grants full control over the shared resource. |
How to use SHARE command:
Share a Folder
share folderName=C:\Folder /remark:"Shared folder"
Shares a folder named “folderName” located at “C:\Folder” with the remark “Shared folder”.
List All Shared Resources
share
Displays a list of all shared resources on the local computer.
Share a Printer
share printerName="MyPrinter" /remark:"Shared printer"
Shares a printer named “MyPrinter” with the remark “Shared printer”.
Stop Sharing a Folder
share folderName=C:\Folder /delete
Stops sharing the folder named “folderName” located at “C:\Folder”.
Share a Folder with Full Control
share folderName=C:\Folder /GRANT:Everyone,FULL
Shares a folder named “folderName” located at “C:\Folder” with full control permission for everyone.
Share a Folder with Read Permission
share folderName=C:\Folder /GRANT:User1,Read
Shares a folder named “folderName” located at “C:\Folder” with read permission for User1.
Share a Folder with Password
share folderName=C:\Folder /GRANT:Everyone,READ /USERS:User1
Shares a folder named “folderName” located at “C:\Folder” with read permission for everyone, requiring a password for User1 to access.
Share a Folder with Maximum Allowed Users
share folderName=C:\Folder /USERS:50
Shares a folder named “folderName” located at “C:\Folder” with a maximum allowed user count of 50.
How do I use share in Windows?
To use the share command in Windows, execute the following command:
share --option <value>
What are the available options for the share command?
The share command in Windows CMD provides various options. Here is an example of sharing a folder with specific permissions:
share folderName=c:\path /GRANT:everyone,FULL
How can I list all shared folders and their permissions in Windows CMD?
To list all shared folders and their permissions in Windows CMD, use the following command:
net share
How do I create a new share using the share command?
To create a new share using the share command in Windows CMD, follow this example:
share newShareName=c:\sharedFolder /REMARK:"Shared folder for project"
How can I assign specific permissions to a shared folder using the share command?
To assign specific permissions to a shared folder using the share command, use the /GRANT option. Here is an example:
share folderName=c:\path /GRANT:username,WRITE
How do I remove a share using the share command in Windows CMD?
To remove a share using the share command in Windows CMD, execute the following command:
share folderName /DELETE
How can I display detailed information about a specific shared resource with the share command?
To display detailed information about a specific shared resource using the share command, use the following syntax:
net share shareName
How do I stop sharing a folder in Windows CMD?
To stop sharing a folder in Windows CMD using the share command, follow this example:
share folderName /DELETE
How do I change the maximum number of users who can connect to a shared resource using the share command?
To change the maximum number of users who can connect to a shared resource using the share command, use the /USERS option. Here is an example:
share folderName /USERS:5
Applications of the SHARE Command
- List shared resources on a computer
- Create a new shared folder
- Modify existing shares
- Remove shared resources
- Display and manage shared resources and their permissions
- Share a folder or printer with specific permissions
- View detailed information about shared resources