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

KdgDev picture KdgDev · Oct 8, 2009 · Viewed 68k times · Source

As far as I'm aware, this is done via the net command.

However, the help section isn't very helpful, as it only shows me the secondary options and not how to use those.

Suppose I had a folder C:\Share_test

How would I make it shared from the command line?

Answer

Sinan Ünür picture Sinan Ünür · Oct 8, 2009

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."