;Deletes last line in text file
SetWorkingDir, C:\test3\ ;path to directory here
File = test10.txt ;file name here
FileRead, text, %File%
FileDelete, %File%
FileAppend, % SubStr(text, 1, RegExMatch(text, "\R.*\R?$")-1), %File%
Run, test10.txt
ExitApp