Anaxibius Posted January 11, 2006 Share Posted January 11, 2006 Is there an easy way to edit the permissions on a particular folder or file within AutoIT? I have tried using CACLS using a Dos command RunWAit line withoput any luck. Thanks for any help. Link to comment Share on other sites More sharing options...
Developers Jos Posted January 11, 2006 Developers Share Posted January 11, 2006 Is there an easy way to edit the permissions on a particular folder or file within AutoIT? I have tried using CACLS using a Dos command RunWAit line withoput any luck. Thanks for any help.I am using the SetAcl commandline utility for that.... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Demonfire Posted January 12, 2006 Share Posted January 12, 2006 (edited) Hey, Im a first time poster, but I often use these forums as reference. I sucessfully made a script that lets you change the permissions to a specified folder, just something basic however, Access + Deny for the current user, with a little modifcation it could be a bit more powerful, the trick is you have to pipe "Y" into the CALCS command. Here is the Code: expandcollapse popup#include <GUIConstants.au3> #Include <process.au3> ;Generated with Form Designer preview $Form1 = GUICreate("Permissions", 405, 117, 190, 119) GUICtrlCreateLabel("Folder Permissions Setter!", 16, 8, 305, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") $Lock = GUICtrlCreateButton("&Lock", 40, 80, 81, 25) $Unlock = GUICtrlCreateButton("&Unlock", 200, 80, 81, 25) GUICtrlCreateLabel("Path:", 8, 48, 29, 17) $path_name = GUICtrlCreateInput("", 40, 48, 241, 21, -1, $WS_EX_CLIENTEDGE) $Browse = GUICtrlCreateButton("&Browse", 296, 48, 81, 25) GUISetState(@SW_SHOW) $path="" While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Unlock $path = guictrlread($path_name) if $path == "" Then MsgBox(16,"Error","No Path Name set, Please Retry.") ElseIf Not FileExists($path)Then MsgBox(16,"Error","Path name invalid!") Else ;MsgBox(0,"","ECHO Y| CACLS """& $path &""" /g "& @UserName &":F") for debuging $cmd=_RunDOS("ECHO Y| CACLS """& $path &""" /g "& @UserName &":F") MsgBox(0,"","UNLOCKED") EndIf Case $msg = $Browse $path=FileSelectFolder("Please Choose a Folder","C:\",1) GUICtrlSetdata($path_name,$path) Case $msg = $Lock $path = guictrlread($path_name) if $path == "" Then MsgBox(16,"Error","No Path Name set, Please Retry.") ElseIf Not FileExists($path)Then MsgBox(16,"Error","Path name invalid!") Else ;MsgBox(0,"","ECHO Y| CACLS """& $path &""" /d "& @UserName ) for debuging $cmd=_RunDOS("ECHO Y| CACLS """& $path &""" /d "& @UserName) MsgBox(0,"","Locked") EndIf Case Else ;;;;;;; EndSelect WEnd ExitPermissions.zipPermissions.au3 Edited January 12, 2006 by Demonfire Link to comment Share on other sites More sharing options...
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