How to create a shared folder from a Windows command prompt?

As far as I know, this is done using the net command.

However, the help section is not very useful, since it shows only secondary parameters, and not how to use them.

Suppose I had a folder C:\Share_test

How can I use it on the command line?

+7
windows cmd
source share
2 answers

C:\> net help share

For example:

To split the C:\Data computer with the common name DataShare and enable the note, type:

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

+15
source share

Using the command "net help share", 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 would like to divide as "Public", the command:

 net share Public=s:\Public 

The above command will automatically provide "All" read permissions only. If you want to give everyone with full control the command:

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

Keep in mind that NTFS permissions are still applied, so even if you could provide EVERYONE with FULL access to the share, you still have to check NTFS security permissions to make sure the right people have permission.

+12
source share

All Articles