Clever1mba Posted May 18, 2005 Posted May 18, 2005 (edited) Helloi have problem getting text to file RunWait("info.txt", "C:\WINDOWS", @SW_MAXIMIZE)actually i dont want to run info.txt i want run text inside info.txttext file contain few files namelike notepade.exe,explorer.exe........etcif any one have solution share it Edited May 18, 2005 by asimzameer
Ejoc Posted May 18, 2005 Posted May 18, 2005 check out _FileReadToArray Start -> Programs -> AutoIt v3 -> AutoIt Help File -> Index -> (The Function you are asking about)----- Links -----DllStruct UDFsRSA Crypto UDFs
MSLx Fanboy Posted May 18, 2005 Posted May 18, 2005 $fHandle = FileOpen("info.txt", "0") Do $x = 1 $line[$x] = FileReadLine($fHandle) $x += 1 Until @error = -1 SetError(0) $arraysize = UBound($line) - 1 $line[0] = $arraysize Hehe, _FileReadToArray() would be much easier than mine Then just do For $x = 0 To $line[0] RunWait(@Comspec & " \c " & $line[$x]) Next Maybe that will help you Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Clever1mba Posted May 18, 2005 Author Posted May 18, 2005 Hello how we can read txt file to internet $file = FileOpen("http://domain.com/mytext.txt", 0)$chars = FileRead($file, 1)MsgBox(0, "Char read:", $chars)
MSLx Fanboy Posted May 18, 2005 Posted May 18, 2005 InetGet() i believe Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
MSLx Fanboy Posted May 18, 2005 Posted May 18, 2005 save the file to, say the temp dir, and then just do FileRead($fHandle) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Clever1mba Posted May 18, 2005 Author Posted May 18, 2005 hello Im trying to do but get error wat problem in it $file = InetGet("http://www.domain.com/myfile.txt", "myfile.txt", 1)$chars = FileRead($file, 1)MsgBox(0, "Char read:", $chars)
MSLx Fanboy Posted May 18, 2005 Posted May 18, 2005 (edited) You're declaring $file as '1' as InetGet() returns '1' on success. You need to do $chars = FileRead("Myfile.txt", 1) or you can do: InetGet("http://www.domain.com/myfile.txt", "myfile.txt", 1) $fHandle = FileOpen("myfile.txt", 0) $char = FileRead($fHandle, 1) FileClose($fHandle) MsgBox(0, "Char read:", $char) Edited May 18, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Clever1mba Posted May 18, 2005 Author Posted May 18, 2005 HELLO okay i understand but can i load direct to website witout save myfile.txt to web i want direct get http://www.domain.com/myfile.txt
MSLx Fanboy Posted May 18, 2005 Posted May 18, 2005 Not that I'm aware of...you can do a FileDelete() afterwards...or, when calling the InetGet, send a fake command, so that it will think that the webpage is different with this new parameter such as $FakeParam = Random(1, 9999, 1) InetGet("http://www.domain.com/myfile.txt?q=" & $FakeParam, "myfile.txt", 1) Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
Clever1mba Posted May 18, 2005 Author Posted May 18, 2005 Hello $fHandle = FileOpen(@SystemDir & "\myfile.txt", 0)$char = FileRead($fHandle, 99999999)FileClose($fHandle)$stopservice = StringSplit($char, ",")For $i = 1 To $stopservice[0]RunWait("net.exe stop " & $stopservice[$i],"",@SW_HIDE)Nextmyfile.txt contains services but when i add services like thisits not workingservice1,service2,etc its working service1,service2, etc........
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now