Jump to content

Setting Shared Folder Permissions - Or Just Sharing the folder!


DirtDBaK
 Share

Recommended Posts

I need my script to create a folder, which I know how to do, BUT I need that folder to be shared over the network as read-only...

Any Ideas on how to solve this problem?

Thanks for all the help

Edited by DBak

[center][/center]

Link to comment
Share on other sites

@Dbak

Maybe this can get you going

Const $FILE_SHARE = 0
Const $MAXIMUM_CONNECTIONS = 25

$strComputer = "."
$objWMIService = $GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & $strComputer & "\root\cimv2")

$objNewShare = $objWMIService.Get("Win32_Share")

$Return = $objNewShare.Create ("C:\Finance", "FinanceShare", $FILE_SHARE, _
                                $MAXIMUM_CONNECTIONS, "Public share for the Finance group.")

For Permissions see my signature SETACL

Regards

ptrex

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...