Jump to content

Talder

Members
  • Posts

    15
  • Joined

  • Last visited

Talder's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi, You could use the _AD_IsMemberOf() function from the adfunctions.au3 UDF. get it from here: http://www.autoitscript.com/forum/index.php?showtopic=106163&hl=ad&st=0 Grtz, Tim
  2. Hi, First off all, great job and very useful UDF! For those who are interested on making connection to a domain controller from a pc that is not registered into any domain, i had to change one line Local $oAD_RootDSE = ObjGet("LDAP://RootDSE") into Local $oAD_RootDSE = ObjGet("LDAP://" & $sAD_HostServerParam & "/RootDSE") and i was able to connect and query the domain controller. (of course you have to provide all necessary parameters to _ad_open()) Without this change you get a COM error. Bye, Tim
  3. Hi, I would use the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run or the one on machine level. You can also use the startup folder by using the macro @StartupDir. Just use a FileCopy() or in case of registry RegWrite() to place your executable in. Bye, Tim
  4. Hi, It's quick and very dirty because I had little time, so I did some cut and past from the help file. If you double click on a item it will show you a msgbox, just replace this with Run or RunAs, ec.... #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $frm_Example1 = GUICreate("Example", 413, 266, 192, 124) GUISetOnEvent($GUI_EVENT_CLOSE, "frm_Example1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "frm_Example1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "frm_Example1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "frm_Example1Restore") $List1 = _GUICtrlListBox_Create($frm_Example1,"", 8, 8, 393, 214) $btn_Add = GUICtrlCreateButton("Add", 8, 232, 73, 25, $WS_GROUP) GUICtrlSetOnEvent(-1, "btn_AddClick") $btn_Remove = GUICtrlCreateButton("Remove", 88, 232, 73, 25, $WS_GROUP) GUICtrlSetOnEvent(-1, "btn_RemoveClick") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") While 1 Sleep(100) WEnd Func btn_AddClick() $sFileToAdd = FileOpenDialog("Select File","c:\","All (*.*)") _GUICtrlListBox_AddString($List1, $sFileToAdd) EndFunc Func btn_RemoveClick() _GUICtrlListBox_DeleteString($List1,_GUICtrlListBox_GetCaretIndex($List1)) EndFunc Func frm_Example1Close() Exit EndFunc Func frm_Example1Maximize() EndFunc Func frm_Example1Minimize() EndFunc Func frm_Example1Restore() EndFunc Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) #forceref $hWnd, $iMsg Local $hWndFrom, $iIDFrom, $iCode, $hWndListBox If Not IsHWnd($List1) Then $hWndListBox = GUICtrlGetHandle($List1) $hWndFrom = $ilParam $iIDFrom = BitAND($iwParam, 0xFFFF) ; Low Word $iCode = BitShift($iwParam, 16) ; Hi Word Switch $hWndFrom Case $List1, $hWndListBox Switch $iCode Case $LBN_DBLCLK ; Sent when the user double-clicks a string in a list box msgbox(0,"Selected data",_GUICtrlListBox_GetText($list1,_GUICtrlListBox_GetCaretIndex($List1))) EndSwitch EndSwitch ; Proceed the default Autoit3 internal message commands. ; You also can complete let the line out. ; !!! But only 'Return' (without any value) will not proceed ; the default Autoit3-message in the future !!! Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Bye, Tim p.s. i used a listbox, but you can do the same thing with a listview of course
  5. Hi, First to read some lines, use a loop and FileReadLine function like this: For $iLoopCounter = 1 to 3 $sLineData = FileReadLine($hFileHandler,$iLoopCounter) Next To find the entry in your case, just exit after you found the first occurrence and did your thing. I would do this with a function and use return to exit it. Bye, Tim
  6. Hi, Use it like this: Local $sUserName = "administrator" Local $sPassword = "blabla" local $sProgramm = "mmc diskmgmt.msc" RunAs($sUserName,@ComputerName,$sPassword,0,$sProgramm) Make sure your user has the right permission, otherwise you will see nothing happen Bye, Tim
  7. Hi SpecialK, use a consolewrite() before your exit() Just tested this out and works like a charm! Greets, Tim
  8. This is Jos his way to tell you that you have made a syntax error ;-)
  9. Otherwise use WinSetOnTop...
  10. Hmm very strange, I use many scheduled tasks and never had any problem. Did you enter some security credentials? (guess yes) Could you post the contents of the task here? (Don't forget to strip out the user/pass ;-) )
  11. I run the most of my scripts on a vmware machine and they work fine. Just tested the MouseMove() function, but this doesn't seems to work. Never used automation functions before on a VM...
  12. You are right, this solves the problem
  13. Hi, Why not run the script with scheduled task? Otherwise you can create a loop, but you will have 100% cpu usage! So this is not such great idea... dim $iTimehascome $iTimehascome = 0 do if @HOUR >= 4 Then ; your code goes here $iTimehascome = 1 EndIf Until $iTimehascome = 1
  14. Why not include the aut2exe in the original compiled script with FileInstall?
  15. Hi NTBM, It's a little bit quick and dirty, but try this: dim $aBodysplit, $iPosition, $sTemp send("^a") send("^c") $Body = ClipGet() ;find replace while StringInStr($Body,@CR,0) <> 0 $iPosition = StringInStr($Body,@CR,0) if StringLen(StringLeft($Body,$iPosition)) > 1 Then $aBodysplit = $aBodysplit & "Text: " & StringLeft($Body,$iPosition) & @CRLF Else $aBodysplit = $aBodysplit & @CRLF endif $Body = StringMid($Body,$iPosition + 2) wend ; Past the rest of the $Body string (except last @cr) if StringLen($Body) > 1 then $aBodysplit = $aBodysplit & "Text: " & $Body EndIf ClipPut($aBodysplit) send("^a") send("{DEL}") send("^v") Does this solves your problem? Greets, Tim.
×
×
  • Create New...