Jump to content

Recommended Posts

Posted (edited)

I'm writing a basic script as follows:

#Include <File.au3>
$FileFullPath = @ScriptDir & "\Test.txt"
#Include <Array.au3>
$FileOpen = FileOpen($FileFullPath, 0)
If $FileOpen=-1 Then
    MsgBox(0, "Notice", "Cannot open file")
    Exit
EndIf
$i = 1
$FileCountLines = _FileCountLines($FileFullPath)
Global $Array[1]
Do
    $FileReadLine = FileReadLine($FileOpen, $i)
    $StringSplit = StringSplit($FileReadLine, ":")
    _ArrayAdd($Array, $StringSplit[1] & ":" & $StringSplit[2])
    _ArrayAdd($Array, $StringSplit[3])
    $i = $i + 1
Until $i = $FileCountLines + 1
_ArrayDisplay($Array, "Show Infor")

With file test.txt is :

C:\Program Files\Yahoo!\Messenger\YahooMessenger.exe:10000
C:\Chrome\chrome.exe:20000
D:\Games\e-Games\NewGAME\~Launcher.exe:15646
C:\Program Files\Muziic\Muziic.exe:1654321

I want to write a simple script , it will be run Applications in test.txt with the number is time out.But I don't know how .

Sorry , I'm newbie

Edited by Unfrog
Posted

Well, as a start, this replaces what you have so far:

#include <File.au3>
#include <Array.au3>

Global $FileFullPath = @ScriptDir & "\Test.txt"
Global $Array
_FileReadToArray($FileFullPath, $Array)
_ArrayDisplay($Array, "Show Infor")

Now you just loop through $Array and process each line as you wish.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...