Jump to content

Recommended Posts

Posted (edited)

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]

Posted

@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

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
×
×
  • Create New...