Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/03/2019 in all areas

  1. I do not, we do however have some folk who have explored its depths like @JLogan3o13. You might get lucky since i tagged him, but better off making a new topic (or changing the title of this one) with keywords in the subject like "Modify controls/behavior of the SCCM update dialog" so you attract those people.
    2 points
  2. @water Your welcome, glad I could help. @Professor_Bernd Here are some examples of _TS_Open that I used to connect to the different computers. ;Connect to a computer in AD where the current user is in a the local Admininstrators group ;on that computer, via domain or local group, or directly. Use AD computer name. Global $oService = _TS_Open("COMPUTERNAME") ;Connect to a computer in AD where the entered user (AdminUser) is an AD user, and is in a the ;local Admininstrators group on that computer, via domain or local group, or directly. Use AD computer name. Global $oService = _TS_Open("COMPUTERNAME", "AdminUser", "AD", "Password") ;Connect to a computer in AD where the entered local user (Administrator) is NOT an AD user, ;and is in a the local Admininstrators group on that computer, via local group, or directly. Use AD computer name. Global $oService = _TS_Open("COMPUTERNAME", "Administrator", ".", "Password") ;Non-domain computer where the entered local user (Administrator) is in a the local Admininstrators group ;on that computer. Use IP address or DNS name to connect. Global $oService = _TS_Open("192.168.0.1", "Administrator", ".", "Password") Adam
    2 points
  3. I had an older version 1.6.2.5 from here https://github.com/dedmen/Autoit/blob/master/APIS/WinHttp.au3. I now downloaded newest version 1.6.4.2 from here https://github.com/dragana-r/autoit-winhttp/blob/master/WinHttp.au3 (also the https://github.com/dedmen/Autoit/blob/master/APIS/WinHttpConstants.au3) and copied the files in my AutoIt include directory. Now the script is working. Thank you very much.
    1 point
  4. Zedna

    Send() is not working

    Instead of WinWait("Untitled - Notepad",0.0) Try WinWait("Untitled - Notepad",0)
    1 point
  5. Looks like it can't find chromedriver.exe. Either place it in your working directory or change the following line to include the full path -- _WD_Option('Driver', 'chromedriver.exe')
    1 point
  6. Try adding the following line before the call to _WD_Startup -- $_WD_DEBUG = $_WD_DEBUG_Info This should result in additional details appearing in the Scite output panel. Rerun the script and post the new output results. You should also get in the habit of checking @error following each UDF call. That way, you can take corrective action or abort the script execution rather than blinding continuing as if an error hasn't occurred.
    1 point
  7. Nine

    RectRgn GetPos

    Ah, I thought the rectangle need to cover all the control, then change the return to this : Return $idPos[0] <= $aPos[2] And $idPos[1] <= $aPos[3] And $idPos[0] + $idPos[2] - 1 >= $aPos[0] And $idPos[1] + $idPos[3] - 1 >= $aPos[1] Makes it more readable. Ya, I forgot about drawing the rectangle from bottom to top or right to left. Good catch
    1 point
  8. Xenobiologist

    Form validations

    Change your while loop to this: While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop case $userButton_Check startvalidation() EndSwitch WEnd Besides, there are parameters for Input that can also help you to validate things.
    1 point
  9. I am using this on recalcitrant process : Local $ProcessName = "JournalProcess.exe" RunWait(@ComSpec & ' /c TaskKill /IM "' & $ProcessName & '" /F')
    1 point
  10. Shutdown -a kills a pending reboot, it does not reset the timer for a system center update. I would guess your solution lies not with AutoIt, but with the System Center configurations to allow your clients to 'snooze'. https://docs.microsoft.com/en-us/sccm/core/clients/deploy/device-restart-notifications **while you can certainly automate the internet suggestion of killing SCNotification and pausing ccmexec, that requires admin level rights in user-land and a metric shit-ton more effort than just making the SCCM change.
    1 point
  11. Thanks, Experts for sharing and suggesting. All you samples are working, the only thing that I missed was my access to that server. I lately noticed that I don't have the right access to delete on our archiving directory😅. I tested the code to my office mate's PC and the code is working even my first original script posted above.✌️😂
    1 point
  12. Nine

    RectRgn GetPos

    Try this - works for me : #include <Constants.au3> #include <GUIConstants.au3> #include <WinAPISysWin.au3> #include <WinAPIGdi.au3> #include <Misc.au3> #include <WinAPIConv.au3> $hGui = GUICreate("Sample GUI", 406, 346) $IdButton3 = GUICtrlCreateButton("Button_3", 68, 89, 65, 30) GUISetState(@SW_SHOW) Local $hDLL = DllOpen("user32.dll"), $aPos While 1 Switch GUIGetMsg() Case $GUI_EVENT_PRIMARYDOWN $aPos = _drawRect() MsgBox ($MB_SYSTEMMODAL,"",Check ($hGui, $IdButton3, $aPos)) Case $GUI_EVENT_CLOSE DllClose($hDLL) Exit EndSwitch WEnd Func _drawRect() $GUIPos = WinGetPos($hGui, "") Global $hRectangle_GUI = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST, $hGui) GUISetBkColor(0x000000) ; Get first mouse position $aMouse_Pos = MouseGetPos() $iX1 = $aMouse_Pos[0] $iY1 = $aMouse_Pos[1] While _IsPressed("01", $hDLL) $aMouse_Pos = MouseGetPos() $hMaster_Mask = _WinAPI_CreateRectRgn(0, 0, 0, 0) $hMask = _WinAPI_CreateRectRgn($iX1, $aMouse_Pos[1], $aMouse_Pos[0], $aMouse_Pos[1] + 1) ; Bottom of rectangle _WinAPI_CombineRgn($hMaster_Mask, $hMask, $hMaster_Mask, 2) _WinAPI_DeleteObject($hMask) $hMask = _WinAPI_CreateRectRgn($iX1, $iY1, $iX1 + 1, $aMouse_Pos[1]) ; Left of rectangle _WinAPI_CombineRgn($hMaster_Mask, $hMask, $hMaster_Mask, 2) _WinAPI_DeleteObject($hMask) $hMask = _WinAPI_CreateRectRgn($iX1 + 1, $iY1 + 1, $aMouse_Pos[0], $iY1) ; Top of rectangle _WinAPI_CombineRgn($hMaster_Mask, $hMask, $hMaster_Mask, 2) _WinAPI_DeleteObject($hMask) $hMask = _WinAPI_CreateRectRgn($aMouse_Pos[0], $iY1, $aMouse_Pos[0] + 1, $aMouse_Pos[1]) ; Right of rectangle _WinAPI_CombineRgn($hMaster_Mask, $hMask, $hMaster_Mask, 2) _WinAPI_DeleteObject($hMask) ; Set overall region _WinAPI_SetWindowRgn($hRectangle_GUI, $hMaster_Mask) If WinGetState($hRectangle_GUI) < 15 Then GUISetState() WEnd GUIDelete($hRectangle_GUI) Return StringSplit ($iX1 & "/" & $iY1 & "/" & $aMouse_Pos[0] & "/" & $aMouse_Pos[1],"/", $STR_NOCOUNT) EndFunc ;==>_drawRect Func Check ($hWnd, $idCtrl, $aPos) Local $tPoint = DllStructCreate("int X;int Y") DllStructSetData($tPoint, "X", $aPos[0]) DllStructSetData($tPoint, "Y", $aPos[1]) _WinAPI_ScreenToClient($hWnd, $tPoint) $aPos[0] = DllStructGetData($tPoint, "X") $aPos[1] = DllStructGetData($tPoint, "Y") DllStructSetData($tPoint, "X", $aPos[2]) DllStructSetData($tPoint, "Y", $aPos[3]) _WinAPI_ScreenToClient($hWnd, $tPoint) $aPos[2] = DllStructGetData($tPoint, "X") $aPos[3] = DllStructGetData($tPoint, "Y") Local $idPos = ControlGetPos ($hWnd, "", $idCtrl) Return $idPos[0] >= $aPos[0] and $idPos[1] >= $aPos[1] and $idPos[0]+$idPos[2]-1 <= $aPos[2] and $idPos[1]+$idPos[3]-1 <= $aPos[3] EndFunc
    1 point
  13. @KickStarter15 Tried the code on a remote server and it's working fine... Either you do not have the rights to access the remote folder, or your remote path is not correct. I'm considering that you have the proper rights-level (Write AND Modify) like it was for my test, I created the same folder (C:\Test) on a remote server and I used the following path for the source: ;$source = "C:\Test"& "\" ;(Local Path) $source = "\\myremotesrv\c$\Test"& "\" ;(Remote path) EDIT: here is the ConsoleWrite() output, and the remote folder has effectively been deleted VERBOSE: Folder=OldFolderFrom2018 VERBOSE: FormattedDate=2018/04/18 15:52:00 VERBOSE: DateDiff-Month(s)=16 VERBOSE: DateDiff-Year(s)=1 VERBOSE: DirectoryRemove \\myremotesrv\c$\Test\OldFolderFrom2018
    1 point
  14. Whats the result if you use something like: If _DateDiff("Y", $sDate, _NowCalcDate()) > 0 Then ConsoleWrite('DirRemove("' & $Source & $aList[$i] & '", 1)' & " - " & $sDate & @CRLF) EndIf
    1 point
  15. I previously gave you several steps you could try to troubleshoot this issue. Have you tried them all?
    1 point
  16. Thanks guys. I was really struggling to follow even the simple examples, but after writing the main functionality of populating a form in C#, I was able to understand the Automation class a bit further -- without the abstraction of AutoIT. Then, I turned my attention back to AutoIT and with your guidance above and the C# experience, I wrote a simple UDF for my specific case. Not only do I appreciate the more AutoIT native syntax, the speed is now fully reasonable. The _UAI_SetVar and _UAI_Action methods (using the unaltered UIAWrappers.au3) takes ~4-seconds to enter a user name into a text field. The revised code below populates that field in ~20-milliseconds. Yeah! Thanks again for the guidance. Sample Code: #include "UIAutomation.au3" ; find parent element $hWindow = WinGetHandle('Sunlight MiniOmni') $aeParent = _getAeFromHandle($hWindow) ; find target element $aeTarget = _getAeFromCondition($aeParent, $UIA_AutomationIdPropertyId, 'txtUserName') ; set target element value _setAeValue($aeTarget, 'username here') My Simple UDF (UIAutomation.au3): #include "CUIAutomation2.au3" Global $aInterfaceObj _UIAutomationInit() Func _UIAutomationInit() $aInterfaceObj = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation ) Return IsObj($aInterfaceObj) ? $aInterfaceObj : False EndFunc ; _UIAutomationInit() Func _setAeValue($aeTarget, $valueStr) Local $patternPointer If Not IsObj($aeTarget) Then Return False $aeTarget.GetCurrentPattern($UIA_ValuePatternId, $patternPointer) $aePattern = ObjCreateInterface( $patternPointer, $sIID_IUIAutomationValuePattern, $dtagIUIAutomationValuePattern) $aePattern.SetValue($valueStr) EndFunc ;_setAeValue() Func _getAeFromCondition($aeParent, $propType, $propStr) Local $targetPointer, $propCondInterfaceObj If Not IsObj($aInterfaceObj) Then Return False If Not IsObj($aInterfaceObj) Then Return False If Not IsObj($aeParent) Then Return False $aInterfaceObj.createPropertyCondition( $propType, $propStr, $propCondInterfaceObj ) $aeParent.FindFirst( $TreeScope_Descendants, $propCondInterfaceObj, $targetPointer) $ae = ObjCreateInterface( $targetPointer, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) Return IsObj($ae) ? $ae : False EndFunc ; _getAeFromCondition() Func _getAeFromHandle($hWindow) Local $winPointer If Not WinExists($hWindow) Then Return False If Not IsObj($aInterfaceObj) Then Return False $aInterfaceObj.ElementFromHandle( $hWindow, $winPointer ) $ae = ObjCreateInterface( $winPointer, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) Return IsObj($ae) ? $ae : False EndFunc ; _getAeFromHandle()
    1 point
  17. 31290

    Keyboard remapping

    Hi There, I'm currently rebinding some of my keys (multimedia ones) and I have two keys that handle the Zoom (+ & -) (just after the calc key) I looked everywhere (in the help file and on Google) but I was not able to find the matching code. Do some of you could have a little idea on how to get their "name" so I'll be able to remap them? Thanks
    1 point
×
×
  • Create New...