Jump to content

NutCracker

Members
  • Posts

    13
  • Joined

  • Last visited

About NutCracker

  • Birthday 08/14/1988

NutCracker's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Spiff59, This almost satisfies my needs , will modify it to look better Thanks..!!
  2. Pasting the code : #include<array.au3> #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> ;$filename = StringReplace($cmdline[1],"'"," ") $filename = $cmdline[1] ; to accept file names having space in between for $i = 2 to UBound($cmdline) - 1 $filename = $filename & " " & $cmdline[$i] Next ;MsgBox(0,"file",$filename) $filehandle = FileOpen($filename) ;$filehandle = FileOpenDialog("","","") ; get input from user $searchinput =InputBox("Enter Search Items","Enter Items in csv format to search multiple items" & @CR & "e.g. TORD1040592755,PHX01040583939,CreateDFOrder","") ;ConsoleWrite($searchinput & @CR) $searcharray=StringSplit($searchinput,",",2) $line = "" ; read line by line Local $matchArray[65535][2] ;Local $insertitem[1][2] $linecount = 1 $aArray=0 $arraycount=0 ;code for gui creation Opt("GUIOnEventMode", 1) GuiCreate("Tracking - " & StringTrimLeft($filename,StringLen($filename)-23), 400,230) GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSE") GUISetState (@SW_SHOW) $editbox=GuiCtrlCreateEdit("", 5,5,390,170,$ES_MULTILINE+$ES_WANTRETURN+$ES_AUTOVSCROLL+$WS_VSCROLL+$ES_READONLY) $slider = GuiCtrlCreateSlider(5, 195, 200) GUICtrlSetOnEvent(-1, "SetTrans") GUICtrlSetData (-1, 100) GuiCtrlCreateLabel("Transparency",70,180) Func SetTrans() ConsoleWrite(GuiCtrlRead($slider) & "%" & @CRLF) ConsoleWrite(GuiCtrlRead($slider) * 2.55 & @CRLF) WinSetTrans("", "", GuiCtrlRead($slider) * 2.55) EndFunc Func CLOSE() Exit 0 EndFunc ;end code for gui creation While True $line = FileReadLine($filehandle) ;ConsoleWrite($line) if @error = -1 Then ConsoleWrite("EOF") sleep(100) Else for $j = 0 to UBound($searcharray) - 1 if(StringInStr($line,$searcharray[$j])) > 0 Then GuiCtrlsetdata($editbox,$searcharray[$j] & " found at line # " & $linecount & @CRLF,1) EndIf ;Next Next $linecount = $linecount+1 EndIf WEnd
  3. Hi , I am trying to create a File Tracker to track the file for containing Text(s). My file is a continuously growing log file , so i need the tracker to not to stop and continue even after EOF is reached. Means the Tracker should not stop anytime unless user says it so by closing it and continue monitoring the log file. The Attached code works , but after sometime it gets into paused state .. which i dont know why. The Program accepts file name as command line input(As it is invoked from another programme). Thanks !! temp.au3
  4. Dont know , but you can use FileInstall() to install plink at run time. Thanks..!!
  5. While ProcessExists("TempFont.exe") ProcessClose("TempFont.exe") ConsoleWrite("closed") sleep(100) WEnd Does this help ?? Thanks..!!
  6. You want to compare Vi2 uae.london.uk PPPoATM 4d04h 00:00:00 <<<<<<<<<<< And ROUTER uptime is 1 week, 2 days, 22 hours, 53 minutes <<<<<<<<<<< ? Thanks..!!
  7. HI, Got the solution myself. The trick is to not close plink . But instead use Stdinwrite($plinkhandle,char(03)) ; sending CTRL +C to the console. Now to pause the the connection to keep the session alive .(Below routine will keep the session alive) while true StdinWrite($_plinkhandle,"date"& @CRLF) $msg = TrayGetMsg() Sleep(1000) Switch $msg Case $end ConsoleWrite("Exiting SSH Pause routine at " & _Now() & @CR) _start_session() Case $ExitItem _plink_close() Exit 0 EndSwitch WEnd It is important to flush the stdout before sending any more command so as to flush out the output generated using the date command which is have used as a dummy command to keep the shell busy. Hope this is useful. Thanks!!
  8. Hi People, I am using plink to obtain the data from a log file on server using the tail command . using the function _start_plink() It is working fine . Only issue is since tail is a never ending command , i use _plink_close() to stop the command. using _ plink_close() also closes my session. Is there any way to maintain the session , like by sending the (CTRL+C) command to the server (same as we do in putty). Thanks!!...
  9. Thanks!! So i think FIle Install is the best way to get my job done .:-D
  10. Thanks Bruce, This partly does the job . Two Questions : 1) The file abc.exe is extracted and still shown to the user, is there a way that the file isnt extracted and its code is executed from my application (Sounds stupid!!) 2) If one is not possible then can i extract the file in hidden mode so that abc.exe remains invisible to the user . Thanks!!
  11. Hi All, I have created an application using AutoIt . As of now it doesn't has any errors and works as desired The problem i have is my application uses another application say "abc.exe" to perform the task. So i need to place "abc.exe" into the script directory. What i want to know is can i embed "abc.exe" into my application so that i can have a single exe file to run . And if there is a way then how to do it . Thanks!!
  12. thanks Juvigy but still not getting what i wanted other word files also get closed: If Not @error Then $oShape.Range.InsertAfter(@CRLF) ;_WordDocSave ( $oDoc ) _WordDocClose ($oDoc,-1) ;_WordQuit($oWordApp, 0, 1, 0)
  13. Hi guys am stuck up at a point, when i save and close a word file all the word files opened get closed. below is the code : $oWordApp = _WordCreate ($wordfile, 1,0) $oDoc = _WordDocGetCollection ($oWordApp, 0) $oRange = $oDoc.Range _WordDocFindReplace($oDoc, $sSearch, "", 0, $oRange) With $oRange ; Insert a new line, updating the range. .insertAfter (@CR) ; Collapse the range to the end point .Collapse ($wdCollapseEnd) EndWith $oShape =_WordDocAddPicture ($oDoc, $file, 0, 1,$oRange) If Not @error Then $oShape.Range.InsertAfter(@CRLF) _WordDocSave ( $oWordApp ) _WordQuit($oWordApp, 0, 1, 0) When i close the word file all other files get automatically closed. What i want is only the created word file should get saved and closed whereas other opened word docs should be untouched. please help me out
×
×
  • Create New...