I need to create a Scripts folder in the Program Files directory and set the
permissions to that scripts directory to give users Modify permissions. I am
not successful in setting the permissions. Any help would be appreciated.

TIA

Jon

Re: Setting folder permissions via script by Charles

Charles
Thu May 26 13:22:15 CDT 2005

Here is a good starting point:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/
setsecuritydescriptor_method_in_class_win32_logicalfilesecuritysetting.asp

Good luck.

Charles

"Jon Paskett" <paskettj@NO.SPAM.email.com> wrote in message
news:u3xoZeZYFHA.2128@TK2MSFTNGP15.phx.gbl...
> I need to create a Scripts folder in the Program Files directory and set
the
> permissions to that scripts directory to give users Modify permissions. I
am
> not successful in setting the permissions. Any help would be appreciated.
>
> TIA
>
> Jon
>
>



Re: Setting folder permissions via script by Carles

Carles
Sat May 28 19:37:25 CDT 2005

Jon Paskett wrote:
>
> I need to create a Scripts folder in the Program Files directory and set the
> permissions to that scripts directory to give users Modify permissions.

You might try:

Dim WshShell, PrFi, MyFolder, fso, fldr, perms
Set WshShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")

MyFolder="0Test"
perms="All:C"

PrFi=WshShell.RegRead("HKLM\" &_
"SOFTWARE\Microsoft\Windows\CurrentVersion\ProgramFilesDir")
MyFolder = PrFi & "\" & MyFolder

Set fldr = fso.CreateFolder(MyFolder)
WshShell.Run "cmd /c echo y|cacls " & """" & Myfolder & """" &_
" /P " & perms, 0
WScript.Echo MyFolder & " persissions set to " & perms


PS: Please, don't send lines longer than 70 characters.
See http://www.webworker.com/reports/report.netiquette.html
--
Regards,

Carles Arjona nospammer@bigfoot.com ( nospammer IS my real username )

Re: Setting folder permissions via script by Ginolard

Ginolard
Mon May 30 02:38:22 CDT 2005

subinacl is the latest MS tool for doing this sort of thing and gives
you considerably more options that cacls.


Re: Setting folder permissions via script by Carles

Carles
Mon May 30 14:32:39 CDT 2005

Ginolard wrote:
>
> subinacl is the latest MS tool for doing this sort of thing
<snip>

Which does not seem available for all NTFS based systems:

http://www.jsifaq.com/SUBR/tip8500/rh8530.htm

Certainly, it cannot be installed in the one i'm using.

--
Regards,

Carles Arjona nospammer@bigfoot.com ( nospammer IS my real username )

Re: Setting folder permissions via script by THEDEVMAN

THEDEVMAN
Fri Jun 10 14:35:53 CDT 2005

I would just use xcacls. It's easier in my opinion than cacls. I have
done this many times.

Example:

xcacls c:\ /y /c /t /g "Domain Users:F"