How can I create a shared folder from the Windows command line?

北慕城南 提交于 2019-11-30 17:58:41

C:\> net help share

For example:

To share a computer's C:\Data directory with the share name DataShare and include a remark, type:

net share DataShare=c:\Data /remark:"For department 123."

Using the "net help share" command you will see that the syntax is as follows:

net share sharename=drive:path

For example, if I had a folder S:\Public which I wanted to share as "Public" the command would be:

net share Public=s:\Public

The above command will automatically grant "Everyone" with Read permissions only. If you want to grant Everyone with Full Control the command would be:

net share Public=s:\Public /GRANT:Everyone,FULL

Keep in mind that NTFS permissions still apply, so even though you might have granted EVERYONE with FULL access to the share, you'll still have to check the NTFS security permissions to ensure that the right people have permission there too.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!