dobbelina Posted May 1, 2010 Posted May 1, 2010 Hi again! I'm trying to set permission for a folder, to full access for Users with CACLS. No matter what i do, it doesn't work? #RequireAdmin RunWait(@SystemDir & '\CACLS.EXE "' & @ProgramFilesDir & '\Xyplorer\Data" /G USERS:F', @ProgramFilesDir & '\Xyplorer', @SW_HIDE) If you run this via commandline there's a "Are you sure (Y/N)?" prompt. I guess this is the culprit. Any solution for this ? I have searched quite a bit here, and nobody seems to have had this problem
Fire Posted May 1, 2010 Posted May 1, 2010 (edited) Hi dobbelina. Yet i have this problem too.When i want to properly 'chmod' in win environment s ome files for Restricted users. BTW solution: I think you can use chmod.exe binary + required cygwin.dll files ( you need 2 dlls for run it in WIN OS properly) ANd what is the cool all this files Opensource. So if you want i can share all required files in here. Or you can find all this required file from cygwin emulator. It works for me cool. Edited May 1, 2010 by Sh3llC043r [size="5"] [/size]
trancexx Posted May 1, 2010 Posted May 1, 2010 Try something like this: #RequireAdmin RunWait(@ComSpec & " /c " & 'echo y | cacls.exe "' & @ProgramFilesDir & '\Xyplorer\Data" /G USERS:F', "", @SW_HIDE) It's a trick. ♡♡♡ . eMyvnE
dobbelina Posted May 1, 2010 Author Posted May 1, 2010 Sorry trancexx, didn't work. Also if the system is a different language, Yes/No has another translation. This is how i will use it, To get the users group name (no matter what language), i will use something similar to this: #RequireAdmin $oWMIService = ObjGet("winmgmts:\\" & @ComputerName & "\root\cimv2") $colItems = $oWMIService.ExecQuery("Select * From Win32_Group Where LocalAccount = TRUE And SID = 'S-1-5-32-545'") For $oItem in $colItems Next $sUser= $oItem.Name ;code under this line is the problem ------------------ RunWait(@SystemDir & '\CACLS.EXE "' & @ProgramFilesDir & '\Xyplorer\Data" /G ' & $sUser&':F', @ProgramFilesDir & '\Xyplorer', @SW_HIDE) Then hopefully execute the cacls command somehow...
trancexx Posted May 2, 2010 Posted May 2, 2010 Sorry trancexx, didn't work.Also if the system is a different language, Yes/No has another translation.Ahh well. It works for me.I would never use it though. And not for the same reasons.If you want to avoid those kind of problems on different systems you won't consider running other programs for the job at all. "Program" that uses other programs is less program and more something else.DLLs are made for that. You have your own memory space and the whole system at our disposal. Use it the way it's meant to be used. ♡♡♡ . eMyvnE
dobbelina Posted May 2, 2010 Author Posted May 2, 2010 (edited) Ahh well. It works for me.I would never use it though. And not for the same reasons.Ahh misstake by me.Now it works. I tested it via a ScITE editor that had been "thinapped".After compiling it works beatifully.I could get around the issue about language, concerningthe other than English (Y/N)prompt, by simply adding xcaclsinstead.It's exactly like cacls but it accepts a yes switch (/y)It's a whopping 44 kb..If you want to avoid those kind of problems on different systems you won't consider running other programs for the job at all. "Program" that uses other programs is less program and more something else.DLLs are made for that. You have your own memory space and the whole system at our disposal. Use it the way it's meant to be used.I wouldn't even know where to start, learning/replicating what CACLS does via dll calls.But if you give me a good hint, i'll be a good student.I wish i had more knowledge about these things, so i didn'thave to ask you gurus to pull out a rabbit every now and then At the moment, dll calls are like Hebrew written backwards,chiseled out on a stone tablet by a drunk viking to me By the way,thanks for all the help so far trancexx and others ! Edited May 2, 2010 by dobbelina
dobbelina Posted May 2, 2010 Author Posted May 2, 2010 (edited) After further examination i discovered that the XCACLStool is a little bit old and buggy.Even though it works, it causes error messages to appear whenchecking the security tab.The best and final solution for me is to use ICACLS.(The latest tool in the CACL series by MS)It's small (26,5 kb)It's fast (xcacls.vbs shitty slow)It supports adding a Sid instead of user name = no language problemThis works beatifully without error messages:#RequireAdmin $programfiles = @ProgramFilesDir RunWait($programfiles & "\Xyplorer\icacls.exe" & ' "' & @ProgramFilesDir & '\Xyplorer\Data" /grant *S-1-5-32-545:(OI)(CI)F', "", @SW_HIDE) Edited May 2, 2010 by dobbelina
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now