All Activity

This stream auto-updates   

  1. Past hour
  2. wow, this look interresting, will take some time to play with it and to understand...thank you .-)
  3. oops. double post. mods please delete this
  4. Yes, exactly like that there. But there is one problem. I prtscn'd and then ran the script. It hung. I did not get the dialog or anything else. Not even through the console. It is simply stuck. Had to exit it through the tray icon. Thank you man, you are a life saver. Yes, exactly like that there. But there is one problem. I prtscn'd and then ran the script. It hung. I did not get the dialog or anything else. Not even through the console. It is simply stuck. Had to exit it through the tray icon. Thank you man, you are a life saver. EDIT: My dumb butt placed my reply inside of your quote. EDIT TWice I ran it for a min, and it finally exited with an error. >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Draygoes\Desktop\savefileengine.au3" Could not open clipboard!!! Finished! >Exit code: 0 Time: 183 Ok, so I never learned the GDI+ Library. So this is very new territory for me. I WILL learn it later on, but I do wish to finish the project that I am currently working on in the next few hours.
  5. I just tested the workaround 1 that was posted above. I commented out the first line and added a declaration for the dummy. Works!! ;~ $gGUIDummy = GUICreate("") Local $gGUIDummy Run("notepad.exe") $HWND = WinWait("Untitled - Notepad") WinActivate($gGUIDummy) ConsoleWrite("Sending..." & @CRLF) ;~ ControlSend($HWND, "", "", "!f") ;control Id 0 is the issue here WinMenuSelectItem($hWnd,"","&File","&Save") ConsoleWrite("sent..." & @CRLF) I think as long as you use a valid dummy variable (not defined on the fly, EVER) it seems to work. no errors.
  6. I can help with the install/uninstall, but you need to also automate using some tool to log onto each machine that needs the install, correct? Is the installer an MSI type? Is it something we can test?
  7. maybe you should file a bug in their system. I get the results you get btw
  8. cool lua script. Some editors, like Sublime Text have built in Goto Anything that can find it if you open the folders to your project. tells you all the places it is referenced in as well. However, even though Sublime Text is great and can run AutoIT, I still use The editor for AutoIT, because it is needed for advanced IUIAutomation stuff. I can't get the IUI stuff to execute properly under Sublime, but perfectly with the native editor, the full version though. THANKS! Rock on.
  9. I think you need to reinstall AutoIt and the SceIte editor and recompile that test.au3 and run it. works fine.
  10. it works for me. copy the text from the SciTE editor please and post it, vial the <> Code tags
  11. Hello, some general aspects to create a dynamic GUI: size and position the GUI and its controls using variables calculate fixed element's height to add them to the required GUI size position controls using relative positioning use an 2D-array to handle control content and control handles dim $a2MyControls[4][2]=[[3], _ ; change "[4][2] = [[3], _" --> to "[24][2]=[[23], _" to see the difference ["Text for control 1","Handle Control one will go here"], _ ["Ctrl 2 Text","handle Ctrl 2"] , _ ["TXT 3"]] $w=300 $Ctrl_h=20 ; Control height: 20 for the control $FixButtonsHeight=30 ; space for the buttons "Go" and Cancel" including space above and below $h=$FixButtonsHeight + $a2MyControls[0][0]* ($Ctrl_h+5) + 20 ; 5 for the "rim" between controls is asumed, plus 20 on top and at bottom $GuiTitle="Dynamic GUI" $MyGui=GUICreate($GuiTitle,$w,$h) $a2MyControls[1][1] = GUICtrlCreateInput($a2MyControls[1][0],10,10,$w-20,$Ctrl_h) Opt("GUICoordMode",2) ; cell relative from now on for $i = 2 to $a2MyControls[0][0] ; 2nd element to end of array $a2MyControls[$i][1]=GUICtrlCreateInput($a2MyControls[$i][0],-1,5) Next ; switch back to absolute control addressing Opt("GUICoordMode",1) $BtnGo=GUICtrlCreateButton("Go",10, $h - $FixButtonsHeight,$w/2-15,$Ctrl_h) $BtnCancel=GUICtrlCreateButton("Cancel",$w/2+5, $h - $FixButtonsHeight,$w/2-15,$Ctrl_h) GUISetState(@SW_SHOW) MsgBox(0,"done","")
  12. Thankyou kylomas for provided link. While am doing my test am getting an error saying undeclared global variables. test.au3
  13. Today
  14. Can anyone provide me with an example to run my reboot script after 30 mins If user wants to defer reboot. Actually we have a scenario where we need to apply HKCU reg hacks and provide user ability to defer reboot twice and force restart 3rd time. Thanks in advance
  15. Sorry all I removed the ip address for security purposes. With running this .*Callback address: ([\d.]+).* on my log file, I am getting the expected results. Thank you all very much for your help. I really need to learn RegEx.
  16. I’ll test it when I get back to pc
  17. Hi. So what is your issue? Regards, Rudi.
  18. do you mean, i should change with my url on the IP address you mentioned?
  19. I found a solution searching here on autoit forum. #include <Constants.au3> #include <GUIListBox.au3> #include <WinAPI.au3> #include <WindowsConstants.au3> Global $gnDRAGLISTMSGSTRING = _WinAPI_RegisterWindowMessage("commctrl_DragListMsg") Global $DL_BEGINDRAG = $WM_USER + 133 Global $DL_DRAGGING = $WM_USER + 134 Global $DL_DROPPED = $WM_USER + 135 Global $DL_CANCELDRAG = $WM_USER + 136 Global Enum $DL_STOPCURSOR = 1, $DL_COPYCURSOR, $DL_MOVECURSOR Global $gtDRAGLISTINFO = "long uNotification;long hWnd;long x;long y" Global $gfItemAdded = False Global $hMain = GUICreate("DragList", 200, 400) Global $cListbox = GUICtrlCreateList("", 16, 16, 168, 368, $WS_BORDER + $WS_VSCROLL) GUICtrlSetFont($cListbox, 10, Default, Default, "Tahoma") Global $hListbox = GUICtrlGetHandle($cListbox) GUICtrlSetData($cListbox, "Apples|Oranges|Bananas|Pears|Grapefruits|Limes|Lemons|Strawberries|Plums|Melons|Grapes|") GUISetState() _ComCtl32_MakeDragList($hListbox) Global $wProcNew = DllCallbackRegister("_MyWndProc", "int", "hwnd;int;wparam;lparam") Global $wProcOld = _WinAPI_SetWindowLong($hMain, $GWL_WNDPROC, DllCallbackGetPtr($wProcNew)) While GUIGetMsg() <> -3 Sleep(10) Wend _WinAPI_SetWindowLong($hMain, $GWL_WNDPROC, DllCallbackGetPtr($wProcOld)) Exit Func _MyWndProc($hWnd, $nMsg, $wParam, $lParam) Local $aRet, $nOldIndex, $sItemText If $nMsg = $gnDRAGLISTMSGSTRING Then Local $tDRAGLISTINFO = DllStructCreate($gtDRAGLISTINFO, $lParam) Local $uNotification = DllStructGetData($tDRAGLISTINFO, "uNotification") Local $x = DllStructGetData($tDRAGLISTINFO, "x"), $y = DllStructGetData($tDRAGLISTINFO, "y") Local $nItem = _ComCtl32_LBItemFromPt($hListbox, $x, $y) Switch $uNotification Case $DL_BEGINDRAG If $nItem < (_GUICtrlListBox_GetCount($hListbox) - 1) Then _GUICtrlListBox_AddString($hListbox, "") $gfItemAdded = True EndIf Return 1 Case $DL_DRAGGING _ComCtl32_DrawInsert($hMain, $hListbox, $nItem) If $nItem = _GUICtrlListBox_GetCurSel($hListbox) Then Return $DL_STOPCURSOR Return $DL_MOVECURSOR Case $DL_DROPPED If $nItem > -1 Then $nOldIndex = _GUICtrlListBox_GetCurSel($hListbox) If $nItem <> $nOldIndex Then $sItemText = _GUICtrlListBox_GetText($hListbox, $nOldIndex) If $nItem < $nOldIndex Then $nOldIndex += 1 _GUICtrlListBox_InsertString($hListbox, $sItemText, $nItem) _GUICtrlListBox_DeleteString($hListbox, $nOldIndex) If $nItem > $nOldIndex Then $nItem -= 1 _GUICtrlListBox_SetCurSel($hListbox, $nItem) EndIf EndIf If $gfItemAdded Then _GUICtrlListBox_DeleteString($hListbox, _GUICtrlListBox_GetCount($hListbox) - 1) $gfItemAdded = False EndIF _ComCtl32_DrawInsert($hMain, $hListbox, -1) Return 0 Case $DL_CANCELDRAG If $gfItemAdded Then _GUICtrlListBox_DeleteString($hListbox, _GUICtrlListBox_GetCount($hListbox) - 1) $gfItemAdded = False EndIF _ComCtl32_DrawInsert($hMain, $hListbox, -1) Return 0 EndSwitch EndIf Return _WinAPI_CallWindowProc($wProcOld, $hWnd, $nMsg, $wParam, $lParam) EndFunc Func _ComCtl32_MakeDragList($hWnd) Local $aRet = DllCall("comctl32.dll", "int", "MakeDragList", "hwnd", $hWnd) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc Func _ComCtl32_LBItemFromPt($hWnd, $x, $y) Local $aRet = DllCall("comctl32.dll", "long", "LBItemFromPt", "hwnd", $hWnd, "long", $x, "long", $y, "long", 1) If @error Then Return SetError(@error, @extended, 0) Return $aRet[0] EndFunc Func _ComCtl32_DrawInsert($hWndParent, $hWnd, $nItem) DllCall("comctl32.dll", "none", "DrawInsert", "hwnd", $hWndParent, "hwnd", $hWnd, "long", $nItem) If @error Then Return SetError(@error, @extended, 0) Return EndFunc
  20. Assuming that in a log file the mentioned IP would necessarily be a valid one, this could be enough $IP = StringRegExpReplace($sText, '.*Callback address: ([\d.]+).*', "$1")
  21. This one extracts the valid IP address after the first occurence of "Callback address: " (11.22.33.444 is not a valid IP) Local $sText = "C&C callback detected Compromised Host: COMPUTER1 IP Address: 122.111.222.33 Domain: Company\Workstations\ Date/Time: 1/22/2018 7:26:30 Callback address: 11.22.33.444 C&C risk level: Dangerous C&C list source: Relevance Rule Action: Blocked" Local $aResult = StringRegExp ($sText, "(?i)Callback address: ((?:(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)\.){3}(?2))\b", 1) MsgBox(0, "", (@error ? "No valid IP found" : $aResult[0]) )
  22. If the IP is always after the string "Callback address:" you could take the result of StringInStr and pass it to StringMid.
  23. Hi. Try this: Local $OrgString="C&C callback detected Compromised Host: COMPUTER1 IP Address: 122.111.222.33 Domain: Company\Workstations\ Date/Time: 1/22/2018 7:26:30 Callback address: 11.22.33.444 C&C risk level: Dangerous C&C list source: Relevance Rule Action: Blocked " Local $RegEx="Callback address: ([\d.]*)" Local $IPOnly=StringRegExp($OrgString,$RegEx, 1) MsgBox(0,"Result",$IPOnly[0]) It shows the first IP after "Callback address: " (there is a trailing space). Regards, Conrad
  24. Hello @rudi Thank you for your help however the log file may contain more then one ip address and I am only looking to retreive the ip address that comes right after "Callback address:" Here is the whole test string: "C&C callback detected Compromised Host: COMPUTER1 IP Address: 122.111.222.33 Domain: Company\Workstations\ Date/Time: 1/22/2018 7:26:30 Callback address: 11.22.33.444 C&C risk level: Dangerous C&C list source: Relevance Rule Action: Blocked"
  25. Hello. $OrgString="Callback address: 11.22.33.222 C&C risk level: Dangerous C&C list source: Relevance Rule Action: Blocked" $RegEx="(^.+?)(\b(?:\d{1,3}\.){3}\d{1,3}\b)(.+$)" $RegExRepl="$2" ; $1 is the string before, $3 the string behind your IP address $IPOnly=StringRegExpReplace($OrgString,$RegEx,$RegExRepl) MsgBox(0,"Replace Result",$IPOnly) As your LOG file will only hold valid IP addresses, it's obviously not necessary, to check for valid IP addresses (numbers < 1..254 vs. 0..255) regards, Rudi.
  26. hallo every one, i tried to write a small tool with it i can add or remove a netwrok drive. can somebody help me. #include <GUIConstants.au3> #include <ComboConstants.au3> ; For GUICtrlCreateCombo #include <File.au3> ; Opt("GUICoordMode", 1) $Window = GUICreate("add or remov network drive", 440,210, -1, -1) GUISetBkColor (0xFFFFFF) GUICtrlCreateLabel("choose letter:", 20, 13, 170, 25) $FreeNetworkdrive = GUICtrlCreateCombo("", 200, 10, 40, 25) GUICtrlCreateLabel("give the path:", 20, 43, 400, 25) $URLNetworkdrive = GuiCtrlCreateInput("", 20, 60, 310, 20) $Networkdrivechoose = GUICtrlCreateButton ("choose path", 340, 60, 80, 20) $Networkdriveconnect = GUICtrlCreateButton ("connect", 20, 100, 160, 25) $close = GUICtrlCreateButton ("close", 310, 100, 110, 25) $UsedNetworkdrive = GUICtrlCreateCombo("", 20, 160, 40, 25) $Networkdriveremove = GUICtrlCreateButton ("remoce", 70, 162, 200, 17) GUICtrlSetBkColor($Networkdriveremove,0xff0000) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit(0) Case $Networkdriveconnect If GUICtrlRead($FreeNetworkdrive) = "" Or GUICtrlRead($URLNetworkdrive) = "" Then MsgBox(16, "Error", "please add all infos!") Else DriveMapAdd(GUICtrlRead($FreeNetworkdrive),GUICtrlRead($URLNetworkdrive),9) If @error Then MsgBox(16, "Error", "Network not connected. Errorcode:" & " " & @error & @CRLF & @CRLF & "-----") Else MsgBox(64, "", "connected") ;GUISetState(@SW_HIDE) ;GUISetState(@SW_ENABLE) ;GUISetState(@SW_SHOW) EndIf EndIf Case $close GUISetState(@SW_HIDE) GUISetState(@SW_ENABLE) GUISetState(@SW_SHOW) Case $NetWorkdriveremove If GUICtrlRead($UsedNetWorkdrive) = "" Then MsgBox(16, "Error", "info not complet!") Else DriveMapDel(GUICtrlRead($UsedNetworkdrive)) If @error Then MsgBox(16, "Error", "Can not remove network ..." & " " & @error & @CRLF & @CRLF & "----") Else MsgBox(64, "", "Network removed") GUISetState(@SW_HIDE) GUISetState(@SW_ENABLE) GUISetState(@SW_SHOW) EndIf EndIf EndSwitch WEnd
  1. Load more activity