Iam trying to loop a batch to create other batch...
that means from batch 1 (listed with commands) iam trying to read 1st line and create another batch 2.
However once the batch 2 is executed, batch 2 will get deleted, also from batch1 first line entry will get removed...
but not working:---
FileClose($mainfile)
; =============================== End of Read given data and Create Transfer Batch
Call ("_checkfile")
EndFunc ;==>Submit
Func _checkfile()
$file=FileOpen("C:\Windows\pyth\transf.bat",0)
While 1
$result=FileReadLine($file)
Call ("_bat")
If @error = -1 Then ExitLoop; end of file
FileClose($file); do something with $result ...
WEnd
EndFunc
Func _bat()
Global $newbatch = ("C:\Windows\pyth\bat\trans.bat")
$readfile = FileOpen("C:\Windows\pyth\transf.bat",0)
$line2 = FileReadLine($readfile,1)
FileOpen($newbatch, 0)
FileWrite($newbatch, $line2 & @CRLF)
While 1
$readfile1 = FileOpen("C:\Windows\pyth\transf.bat",0)
$result1=FileReadLine($readfile1)
_FileWriteToLine($result1, 1, "", True)
ShellExecuteWait("trans.bat", "", "C:\Windows\pyth\bat\", "")
FileDelete ($newbatch)
If @error = -1 Then ExitLoop; end of file
FileClose($readfile)
FileClose($newbatch)
WEnd
EndFunc