icecom4
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.
I will be running this using psexec on several computers at once. This way I dont have to kick the user.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yup, check it out.
It's the default and only group added to the Sharing permissions with that command.
It's the default and only group added to the Sharing permissions with that command.
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
Example
net share icecom4=D:\testshare
You can verify the results with:
net share
ASKER
oops nevermind i just changed the "file" in batch
At a command prompt do a net share /?
Depending on OS version, you can set permissions as well.
Depending on OS version, you can set permissions as well.
Typo on my part. It was example I showed somebody else a while back.
@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
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.
Doesn't work on XP and I don't think it works on 2000 but should work on everything after that.
ASKER