AutoIt automatically closes opened files when exiting, so using FileClose is likely only necessary under special circumstances. You can not use filenames when using FileClose – when using filenames rather than handles, with functions such as FileRead, the files will automatically be opened and closed.
Returns 1 on success, and 0 if the filehandle was invalid.
AutoIt FileClose Example
The below is an example that uses FileClose after opening a file, and writing a couple of lines to the file.
$file = FileOpen("SomeFile.txt", 1) FileWrite($file, "This is the first line written with AutoIt." & @CRLF) ; The CRLF at the end is a line break FileWrite($file, "Second line of the file.") FileClose($file)