4

I am trying to create a share on a Windows Server 2008.

I can do it fine via the GUI and everything works like a charm.

But when I try to do it via the command prompt (I need the command prompt for a FinalBuilder WMI action step), nothing happens.

I use the command:

C:\>net share MyShare=d:\MyShareFolder /grant:Everyone,FULL

It returns a message like "Share was created", and it is indeed created - but the permissions are not applied.

I originally tried to grant a specific user to the share, but this also fails. The command was this:

C:\>net share MyShare=d:\MyShareFolder /grant:domain\myuser,FULL

I also tried to use double-quotes around the domain\user-specification, but same result.

There must be something that I am missing - but what is it?

Thanks,

/Jesper

Jesper Lund Stocholm
  • 1,973
  • 2
  • 27
  • 49

2 Answers2

4

You have to make sure that the user have permissions granted to the folder.

Ex.:

icacls "d:\MyShareFolder" /grant myuser:(OI)(CI)F
Griner
  • 151
  • 1
  • 8
0

How do you know it fails? It works here. You need quotes if there are spaces in a name.

You do know that file permissions still apply. A user needs share and file permissions.

Noodles
  • 1,981
  • 1
  • 11
  • 4