/build/static/layout/Breadcrumb_cap_w.png

set folder security with vbs

hi all,

i would like to add a custom action into my msi to run an embedded vbs script to change the security of a local folder.

i don't wish to use cacls.exe, only vbs.

could it be done?

thanks!

0 Comments   [ + ] Show comments

Answers (3)

Posted by: aogilmor 15 years ago
9th Degree Black Belt
0
I'm pretty sure there are vbscripts already that do this, use the search.
Posted by: anonymous_9363 15 years ago
Red Belt
0
i don't wish to use cacls.exe, only vbs.Well, that would be a neat trick, since VBScript has zero support for setting permissions.

At some point, you will need to call either a command line tool (like CACLS [XCACLS is light years easier to use, BTW, and it does registry permissions which CACLS doesn't], SetACL, etc) or you'll need to to use the ADsSecurity objects. This http://cwashington.netreach.net/depo/view.asp?Index=360&ScriptType=vb is a nice VBS file which uses those. If you wanted to go that route, your package will need to install and register ADsSecurity.DLL (and probably its companions ADsError.DLL and...I've forgotten, but they're in the ADSI SDK, too).

I converted the script to a class file ages ago so that I could re-use it for other projects. And no, I won't post copies to anyone.
Posted by: shweta_kar 15 years ago
Blue Belt
0
Hi,

You can set permission using Setacl through Vb script.
http://setacl.sourceforge.net/html/examples.html.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ