MariusN Posted November 30, 2011 Share Posted November 30, 2011 (edited) RunWait(@TempDir & 'SetACL.exe -on ' & '"' & $Select0 & '"' & ' -ot file -actn ace -ace "n:Everyone;p:full" -actn ace -ace "n:Administrators;p:full"' _ & ' -actn setowner -ownr "n:SYSTEM" -actn ace -ace "n:SYSTEM;p:full" -rec cont_obj', "", @SW_SHOW) As you can see, the above command is using a file caled SetAcl to change permishions...It works 100%, but i'm trying to make it show the output WITHIN my script...I have tried Stdout , but to no avail. Is there any alternitive? Maybe something like a console read or somethin, as i do believe that certain applications cant work with Stdout. Reason for asking this, is i want to make my code more "decent", and not showing that a 2nd app is actually running. Here is one i did checking the network wich works 100%, but no go with SetACL Func Status() Local $h_gui, $i_edit, $h_edit Local $s_stdout, $i_pid, $i_timer Local $s_ip = @IPAddress1 Local $i_sec = 1 $h_gui = GUICreate("Current Connections on IP: " & $s_ip, 540, 400, -1, 20) $i_edit = GUICtrlCreateEdit("", 10, 10, 520, 380) GUISetState() $h_edit = GUICtrlGetHandle($i_edit) $i_timer = TimerInit() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch If TimerDiff($i_timer) / 1000 >= $i_sec Then $i_pid = Run(@ComSpec & " /c netstat -p TCP", @SystemDir, @SW_HIDE, 6) While 1 $s_stdout &= StdoutRead($i_pid) If @error Then ExitLoop WEnd If $s_stdout Then WinSetState($h_edit, "", @SW_LOCK) GUICtrlSetData($i_edit, "") GUICtrlSetData($i_edit, $s_stdout) WinSetState($h_edit, "", @SW_UNLOCK) EndIf $s_stdout = "" $i_timer = TimerInit() EndIf WEnd GUIDelete() EndFunc ;==>Status Edited November 30, 2011 by MariusN Link to comment Share on other sites More sharing options...
water Posted November 30, 2011 Share Posted November 30, 2011 (edited) It can and has been done before. Please search the forum for "setacl stdout" and you will find something like Edited November 30, 2011 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki Link to comment Share on other sites More sharing options...
KaFu Posted November 30, 2011 Share Posted November 30, 2011 (edited) Maybe do not use SetACL.exe altogether and give this a try? Edited November 30, 2011 by KaFu MariusN 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
MariusN Posted November 30, 2011 Author Share Posted November 30, 2011 Maybe do not use SetACL.exe altogether and give this a try?Eish man, what a bargain...didnt even know Permissions.au3 exists...lol...thx KaFu Link to comment Share on other sites More sharing options...
MariusN Posted November 30, 2011 Author Share Posted November 30, 2011 $ret2 = _SetObjectOwner(@HomeDrive&'junk',$SE_FILE_OBJECT, "System") The above code works 100%, but is there a way to make it Recurse? ( I'ts a Directory with Subs ) ...tia Link to comment Share on other sites More sharing options...
KaFu Posted November 30, 2011 Share Posted November 30, 2011 For this task I would recommend Melba23s excellent ... MariusN 1 OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
kylomas Posted November 30, 2011 Share Posted November 30, 2011 (edited) MariusN, Recursion is no more complicated than the following... func spin_files($folder) local $hfldr= FileFindFirstFile($folder & "*.*") if $hfldr = -1 then msgbox(0,'Error from filefindfirst','@error = ' & @error) While 1 $file = FileFindNextFile($hfldr) if @error then exitloop if @extended then spin_files($folder & '' & $file) else $s_fls &= $folder & '' & $file & @crlf endif WEnd fileclose($hfldr) return $s_fls endfunc or use Melba's UDF.... or search for file recursion, there are many threads on this topic... kylomas Edited November 30, 2011 by kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
MariusN Posted December 1, 2011 Author Share Posted December 1, 2011 thx kylomas....i did the above, but forgot the "*.*"....lol 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