AdamUL
Active Members-
Posts
715 -
Joined
-
Last visited
-
Days Won
3
AdamUL last won the day on February 6 2020
AdamUL had the most liked content!
About AdamUL
- Birthday 12/07/1976
Profile Information
-
Location
Louisville, KY
AdamUL's Achievements
-
RichardL reacted to a post in a topic: Time and Date Conversion UDF
-
ahmeddzcom reacted to a post in a topic: Multiple statements on one line?
-
wongshing1439 reacted to a post in a topic: RunAs not fully elevated (UAC issue)
-
v4nandu reacted to a post in a topic: unable to open snipping tool using run
-
PoojaKrishna reacted to a post in a topic: Time and Date Conversion UDF
-
hudsonhock reacted to a post in a topic: RunAs
-
@Valnurat Sorry about that. I forgot that some function were not in the original UDF. The one ptrex linked is the one. I updated the UDF to use Unicode. That is the one I'm using. Here is the link. Adam
-
@Valnurat Here is you an example, using the UDF. #include <Debug.au3> #include <Security.au3> #include 'Permissions.au3' Global $sFile = @ScriptDir & '\test.txt' FileWrite($sFile, 'test') MsgBox(0, "File", "Created") _InitiatePermissionResources() ;Get the file's DACL. ;Do not include inherited permissions. ;~ $pDACL = _GetObjectDacl($sFile) ;~ If @error Then Exit MsgBox(16, "ERROR", "Error _GetObjectDacl") ;Include inherited permissions. $pDACL = _GetObjectDaclIncludeInherit($sFile) If @error Then MsgBox(16, "ERROR", "Error _GetObjectDaclIncludeInherit") ;Create an empty array to fill with the DACL read from the object. Global $aPerm[0][4] $iRet = _MergeDaclToArray($pDACL, $aPerm) ;If there are no explicit permissions, and only inherited, the return valuse will be 0, if you used _GetObjectDacl. MsgBox(0, '', '_MergeDaclToArray return value: ' & $iRet) If $iRet = 0 Then Exit 2 ;SIDs are DLL structs so they show up as blank strings in the array. Pemissions show up as signed integers. ;$array[n][0] - SID structure. ;$array[n][1] - The access type. A value of 1 grants acecess, 0 denies access. ;$array[n][2] - The access mask. _DebugArrayDisplay($aPerm, $sFile) ;Show users and groups in the DACL array as strings. Global $aAcct Global $pAcct Global $sAcct For $i = 0 To UBound($aPerm, 1) - 1 $pAcct = DllStructGetPtr($aPerm[$i][0]) ;Convert SIDs to users and groups strings. $aAcct = _Security__LookupAccountSid($pAcct) If Not IsArray($aAcct) Then $aPerm[$i][0] = _Security__SidToStringSid($pAcct) ;Put SID string for unknown SID. ContinueLoop EndIf $sAcct = ($aAcct[1] <> "" ? $aAcct[1] & "\" : "" ) & $aAcct[0] ConsoleWrite($sAcct & " _Security__IsValidSid: " & _Security__IsValidSid($pAcct) & @CRLF) ;Replace struct with string. $aPerm[$i][0] = $sAcct Next _ClosePermissionResources() ;User and group names changed to strings to be viewable and searchable. _DebugArrayDisplay($aPerm, $sFile) FileDelete($sFile) MsgBox(0, "File", "Deleted") @ptrex I would like to see and example using Powershell. If possible, I would like to see how to get the users' or groups' specific permissions. Thanks. Adam
-
Sorry, but currently I do not know of any functions in this UDF that will give the individual permissions directly. You can read them with the UDF. I have examples in this thread that show how to search for a user or group and change their permissions. Functions would need to be created to show the individual permissions. Adam
-
Colduction reacted to a post in a topic: [Solved] SQLite - SQLite3.dll Can't be Loaded
-
WinMove FileOpenDialog - (Solved)
AdamUL replied to ripdad's topic in AutoIt General Help and Support
Here is a example using GUICreate. #include <Constants.au3> #include <WindowsConstants.au3> ;~ Global $hWnd = GUICreate("", -1, -1, 50, 50, $WS_POPUP) ;Left = 50, Top = 50 Global $hWnd = GUICreate("", -1, -1, @DesktopWidth / 4, @DesktopHeight / 4, $WS_POPUP) ;Centered Global $sFilePath = FileOpenDialog("", "", "CSV (*.csv)|Images (*.jpg;*.bmp)|Videos (*.avi;*.mpg)", $FD_FILEMUSTEXIST, "", $hWnd) If @error Then Exit GUIDelete($hWnd) ConsoleWrite(@CRLF & $sFilePath & @CRLF & @CRLF) Adam -
TheXman reacted to a post in a topic: Unlock a local user account - Windows 10
-
Earthshine reacted to a post in a topic: Unlock a local user account - Windows 10
-
Unlock a local user account - Windows 10
AdamUL replied to ITSCSteve's topic in AutoIt General Help and Support
You could also use the Local Account UDF. Example below. #RequireAdmin #include <LocalAccount.au3> Global $sUserName = "Admin" _AccountDisableProperty($sUserName, $ADS_UF_LOCKOUT) If @error Then ConsoleWrite(@error & @CRLF) Adam -
robertocm reacted to a post in a topic: Retrieve info from google sheets - (Moved)
-
Document frickin huge scripts that are not mine
AdamUL replied to BigDaddyO's topic in Developer General Discussion
You could try using Tidy with the /gd switch to generate docs for each test script. The report is a text file, but it might be something you could work with. https://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/Tidy.html Adam -
AdamUL reacted to a post in a topic: File and printer sharing for Microsoft networks
-
File and printer sharing for Microsoft networks
AdamUL replied to graybags's topic in AutoIt General Help and Support
Have you rebooted the machine after running it, or logging out and back in again? Also, have you tried connecting to the PC from another PC? Adam -
File and printer sharing for Microsoft networks
AdamUL replied to graybags's topic in AutoIt General Help and Support
@graybags I have updated my code above. Sorry about that, I copied it from a larger script without using Au3Check, and missed adding the additional code. Adam -
File and printer sharing for Microsoft networks
AdamUL replied to graybags's topic in AutoIt General Help and Support
Here is a function that I use to enable file and print sharing on Windows 7 and Windows 10 PC. #RequireAdmin #include <Constants.au3> #include <WinAPIFiles.au3> Global Const $sSystemDir = @WindowsDir & "\System32" ;@SystemDir returns @WindowsDir & "\SYSWOW64" with a 32 bit script. Func _EnableFileAndPrintSharing() ;Enable File and Print Sharing. ;Disable x86 redirection mechanism for a 32-bit script. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(False) Local $iPIDNetsh = Run('netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=yes', $sSystemDir, @SW_HIDE, $STDERR_MERGED) ;Enable File and Print Sharing ;Enable x86 redirection mechanism for a 32-bit script. If @OSArch = "X64" And Not @AutoItX64 Then _WinAPI_Wow64EnableWow64FsRedirection(True) ProcessWaitClose($iPIDNetsh) Local $sNetshOutput = StringStripWS(StdoutRead($iPIDNetsh), $STR_STRIPLEADING + $STR_STRIPTRAILING) If StringRegExp($sNetshOutput, "Updated \d+ rule\(s\)\.\s*Ok\.") Then Return True Return SetError(1, 0, False) EndFunc ;==>_EnableFileAndPrintSharing Adam -
[SOLVED] Case triggering on _Timer_GetIdleTime()
AdamUL replied to silber's topic in AutoIt General Help and Support
You are using Switch incorrectly, use Select or If instead. #include <Timers.au3> While 1 $CurrIdleTime = _Timer_GetIdleTime() Select Case $CurrIdleTime >= 10001 MsgBox(64,"Current Idle Time",$CurrIdleTime) Exit EndSelect WEnd Adam -
AdamUL reacted to a post in a topic: RegWrite is not working properly on Windows 10 64bit
-
RegWrite is not working properly on Windows 10 64bit
AdamUL replied to cesinha87's topic in AutoIt General Help and Support
Have a look at engine's HKCUReg UDF. It allow you to write to all user profiles or only certain ones. It will do the registry hive load and unload within the UDF. Adam -
Array scan - what am I doing wrong?
AdamUL replied to ahha's topic in AutoIt General Help and Support
"M" is getting converted to 0. That is why it is showing 8 M's, when it is actually 8 0's. Use the following instead for a case sensitive string compare. If $aArray[$i][1] == "M" Then Adam -
Maybe you are thinking of a session file. You could use a session file for each project. Load all the file you want to work with for a project, then File->Save Session..., give it your project name, and save it in the directory with you project. Then to load it, open SciTE and then File->Load Session... You will just need to remember to save the session file if you create or open new files for the project. Also, a session file is automatically saved in your user profile "%USERPROFILE%\AppData\Local\AutoIt v3\SciTE" as a "SciTE.session" file. Adam
-
error trying to send a Linux command
AdamUL replied to edumanilha's topic in AutoIt General Help and Support
Try using Plink, instead of PuTTY? Adam