Total_newbie Posted August 30, 2006 Posted August 30, 2006 Hi Guys, I've been fighting with this issue in the last hour. I'm trying to delete my compiled script when exiting the script. I'm using @AutoitExe to get the script name that needs to be delete but FileDelete is not deleting this file. My code is below Opt("OnExitFunc","_Cleanup") $file = FileOpen("test.txt", 0) $output="log.txt" $handle = FileOpen($output,1) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop FileWriteLine($output, "Line read:" & $line) Wend FileClose($file) FileClose($handle) Func _Cleanup() FileDelete(@AutoitExe) EndFunc
Valuater Posted August 31, 2006 Posted August 31, 2006 in scite... type in "selfdelete" and press the space bar 8)
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