99ojo
Active Members-
Posts
829 -
Joined
-
Last visited
About 99ojo
- Birthday April 23
Profile Information
-
Location
Bonn, Germany
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
99ojo's Achievements
Universalist (7/7)
0
Reputation
-
Search a .txt to see if it contains values in a .INI
99ojo replied to Shakala's topic in AutoIt General Help and Support
Hi, if i catch you right, you want to save $SouceText[2] into an ignore list. 1) Save your ignore list into a file. 2) Read this file into an array. -> _FileListToArray () 3) Perform a search over the array, to check, if the line string is in the array. -> _ArraySearch () 4) If not in array, perform your $SearchResults..... If you find the string, add this line to your ignore list and do an _ArrayAdd ($arignore, FileReadLine ("ignore.txt", -1)) -> Read Last Line from ignore.txt and put value into ignore array for later or more comparisons. This might helps you for further coding...... ;-)) Stefan P.S: This is all i will give you........ -
Hi, 1) FileGetTime doesn't work with Wildcards. 2) FileGetTime returns an array. Try this: #include <Date.au3> #Include <File.au3> Dim $i, $arfile $sFolder = InputBox("Backup-Cleaner", "Please type in filepath correctly", "C:\Downloads") If @error = 1 Then MsgBox(4096, "Backup-Cleaner", "Aborted by User") Exit EndIf $iMaxDays = InputBox("Backup-Cleaner", "Type in the age of files which should be removed e.g.= 14", "14") If @error = 1 Then MsgBox(4096, "Backup-Cleaner", "Aborted by User") Exit EndIf ;get all files into array $arfile = _FileListToArray ($sFolder, "*.doc", 1) If @error Then MsgBox (0,"Error", "Path or no documents found!!") Exit EndIf For $i = 1 To UBound ($arfile) - 1 ;get modified date of file, return is an array $t = FileGetTime ($sFolder & "\" & $arfile [$i]) ;if difference is bigger then input in days -> delete file, see helpfile _DateDiff () If _DateDiff ("D", $t [0] & "/" & $t [1] & "/" & $t [2], _NowCalcDate ()) > $iMaxDays Then FileDelete ($sFolder & "\" & $arfile [$i]) EndIf Next ;-)) Stefan
-
ShellExecuteWait() and errorlevels
99ojo replied to Phenom's topic in AutoIt General Help and Support
Hi, if help file is correct, yes and no: If the called program returns different exit codes for different errorlevels: Helpfile ShellExecuteWait () Success: Returns the exit code of the program that was run. ;-)) Stefan -
how to check if an input box is empty
99ojo replied to Phenom's topic in AutoIt General Help and Support
Hi, as Zorphnog suggests: $input1 = GuiCtrlCreateInput....... If GuiCtrlRead($input1) = "" Then MsgBox (0,"Empty.....", "....Input detected!") ;-)) Stefan -
How to get path from multiple files ?
99ojo replied to madasraka's topic in AutoIt General Help and Support
Hi, if you need path and filenames for further coding, i'd use: $sString = "C:\Users\Administrator\Desktop\System|DN3D_pickups.u|Dweather.u|Dweather.ucl" $artemp = StringSplit ($string, "|") MsgBox (0,"", "Path: " & $artemp [1]) For $i = 2 To $artemp [0] MsgBox (0,"", "File: " & $artemp [$i] & @CRLF & "Full Path: " & $artemp [1] & "\" & $artemp [$i]) Next ;-)) Stefan -
Hi, how did you test? My example works fine on Win 7 64 Bit Ultimate (Compiled and as au3 script); but it is running as a VMWare machine. I use a local stored swf file without problems. You may post your test code if you haven't tried mine and i can test it on monday on my Win 7 machine. By the way, how do i know, which browser, 64 bit or 32 bit version, is used as embedded object? Both are available! ;-)) Stefan P.S: ?? It might be a combination of ie, flash and graphic driver ??
-
Hi, my solution with your 3 origin arrays. Depends what you want, you may prefer Melba's solution. Local $1[4] = [315,275,366,254] Local $2[4] = [345,298,430,265] Local $3[4] = [485,485,470,275] $run = 1 _mysum ($1) _mysum ($2) _mysum ($3) Func _mysum ($array) $sum = $array [0] $sum1 = $array [1] $sum2 = $array [2] $sum3 = $array [3] MsgBox (0, "Sum Run " & $run, $sum & @CRLF & $sum1 & @CRLF & $sum2 & @CRLF & $sum3) $run += 1 EndFunc ;-)) Stefan @Melba23: HaHaHaHaHa, thanks ....
-
Hi, so do 1st a RegRead and look for the return / @error. Failure: Returns "" and sets the @error flag: 1 if unable to open requested key 2 if unable to open requested main key Then you can do a RegWrite to write the missing keys. If you have @error 2 you have to do 2 RegWrite's. See helpfile RegWrite: Creates a key or value in the registry. RegWrite ( "keyname" [,"valuename" [, "type" [, value]]] ) ;-)) Stefan
-
Problem with while loops and if
99ojo replied to niubbone's topic in AutoIt General Help and Support
Hi, for exiting the second while loop, $condition has to be bigger then 9. Since $condition never changes in the 2nd while loop, it will run 4 ever: !! $condition=Random(1,5,1) !! You missed the else for the 2nd If $clickcount < 20: If $ClickCount<20 Then; ITS ELSE DOESNT WORK! <- can't, because you are sticking in the while loop following While 1 If $ClickCount<20 Then ; !! This else is missing with an exit loop !! ; or you might change it to: If ClickCount = 20 Then ExitLoop ;code as follows ;-)) Stefan -
List Running Tasks on Remote Machine
99ojo replied to Naveed's topic in AutoIt General Help and Support
Hi, you try to check, if item 1 is selected. Therefore you only get True or False (i guess mostly false ) in your msgbox. See helpfile function _GUICtrlListView_GetItemSelected (). Try this: Func kill() $arselect = _GUICtrlListView_GetSelectedIndices ($in1, "True") If $select [0] = "" Then MsgBox (0,"Error", "No Selection") Else MsgBox(1,"",_GUICtrlListView_GetItemText($in1, $arselect [1]),5) EndIf EndFunc If you want to allow multi selection in your listview, you have to loop over array $arselect: For $i = 1 To $arselect [0] MsgBox(1,"",_GUICtrlListView_GetItemText($in1, $arselect [$i]),5) Next in the else tree. ;-)) Stefan -
Hi, changes: ;Opt("GUIOnEventMode", 1) Func createGUI() Global $hGUI = GUICreate("Input",350,150) GUICtrlCreateLabel("Enter the Row Number of the stream to be loaded :",10,20,250,75) Global $readedit = GUICtrlCreateInput(" ",270,15,75,20) GUICtrlCreateLabel("Select the Frequency to be set from the list:",10,50,250,75) Global $hCombo = GUICtrlCreateCombo("473", 270, 50, 75, 20) GUICtrlSetData(-1, "479|485|491|497|503|509|515|521|527|533|539|545|551|557|563|569|575|581|587|593|599|605|611|617|623|629|635|641|647|653|659|665|671|677|683|689|695|701|707|713|719|725|731|743|749|755|761|767", "") ; add other item snd set a new default Global $setvaluebuttn = GUICtrlCreateButton("Set Value",90,95,70) ;GUISetOnEvent(-1,"validate") Global $exitappbuttn = GUICtrlCreateButton("Exit",190,95,70) GUISetState() GUISetState(@SW_SHOW) EndFunc While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $setvaluebuttn validate () Case $msg = $exitappbuttn Exit EndSelect WEnd You should resort your code in a better way. It looks a little bit messy with your formats and coding style...... ;-)) Stefan
-
List Running Tasks on Remote Machine
99ojo replied to Naveed's topic in AutoIt General Help and Support
Hi, try this: #include <GUIConstantsEx.au3> #include <array.au3> ;Opt("GUIOnEventMode", 1) GUICreate("My GUI",600,600) GUISetState(@SW_SHOW) $test = GUICtrlCreateButton("List Tasks",20,20,100,100) ;GUICtrlSetOnEvent($test,"gettasks") $test2 = GUICtrlCreateButton("Kill Tasks",120,20,100,100) ;GUICtrlSetOnEvent($test2,"") ;GUISetOnEvent($GUI_EVENT_CLOSE,"exit1") $in = GUICtrlCreateInput("",20,130,200,200) Global $in1 = GUICtrlCreateListView("Tasks ",230,130,200,200) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $test gettasks () Case $msg = $test2 exit1 () EndSelect WEnd Func exit1() Exit EndFunc ;use gettask ("Hostname") to get processes from other computer Func gettasks($strComputer = "localhost") $count = 1 Local $arTasks [1] $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_Process", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then Local $Object_Flag = 0 For $objItem In $colItems $Object_Flag = 1 ReDim $arTasks [$count] $arTasks [$count - 1] = $objItem.Caption $count += 1 ;GUICtrlCreateListViewItem ($objitem.Caption, $in1) ;if Msgbox(1,"WMI Output",$Output) = 2 then ExitLoop Next _ArraySort ($artasks) For $i = 0 To UBound ($artasks) - 1 GUICtrlCreateListViewItem ($artasks [$i], $in1) Next ;If $Object_Flag = 0 Then Msgbox(1,"WMI Output",$OutputTitle) Else Msgbox(0,"WMI Output","No WMI Objects Found for class: " & "Win32_Process" ) Endif EndFunc ;-)) Stefan -
[Solved] How to distinguish between file & folder ?
99ojo replied to goldenix's topic in AutoIt General Help and Support
Hi, yes there is. See FileGetAttrib ( ). ;-)) Stefan -
Yes indeed, there isn't.You haven't read my proposal to search forum, not helpfile, for _INetSmtpMailCom (), haven't you? ;-)) Stefan
-
Hi, 1) Did you see any param for password in function _INetSmtpMail () in helpfile? I don't. If you need authentication, search in forum for _INetSmtpMailCom (). 2) I don't know any script for receiving mail, sorry. ;-)) Stefan