Link to home
Start Free TrialLog in
Avatar of icecom4
icecom4Flag for United States of America

asked on

batch script to create a shared folder with permissions for everyone group

Hello,  I need a batch script to create a shared folder with permissions for the "everyone" group.  
I will be running this using psexec on several computers at once.  This way I dont have to kick the user.
ASKER CERTIFIED SOLUTION
Avatar of motnahp00
motnahp00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of icecom4

ASKER

hmmm that adds to the "everyone" group?
Yup, check it out.

It's the default and only group added to the Sharing permissions with that command.
Avatar of icecom4

ASKER

ok, thanks, but i notice that it names the shared path folder "file" and not "testshare"
Just substitute the example with whatever name you like:

Example

net share icecom4=D:\testshare

You can verify the results with:

net share
Avatar of icecom4

ASKER

oops nevermind i just changed the "file" in batch
Avatar of Steven Carnahan
At a command prompt do a net share /?

Depending on OS version, you can set permissions as well.
Typo on my part. It was example I showed somebody else a while back.
Avatar of Francois_IT
Francois_IT

@echo off
MD [directory]
CACLS [directory] /E /G everyone:[permission level (RWCF)]
NET SHARE [sharename]=[directory]
EXIT

use the CACLS /? for more info
use the NET SHARE /? for more info
You can set permissions but I have mastered that skill yet. =)
net share cshare=c:\shared /GRANT:Everyone,FULL

Doesn't work on XP and I don't think it works on 2000 but should work on everything after that.