1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ;========================================================================== ; ; NAME: write to file example ; AUTHOR: John Sorensen ; ; COMMENT: login autoIT script/snippet to check for file and log if exists ; ;========================================================================== ;check if file exists, if so then log and exit If FileExists(@ProgramFilesDir & "\program\someprogram") Then $PCName = @ComputerName $file = Fileopen("\\server\shared_folder\log.txt", 1) ; Write month/day @ time FileWrite($file, @mon & "/" & @MDAY & " @ " & @HOUR & ":" & @MIN & " - ") ; Write computer name along with text FileWrite($file, $PCName & " - " & "File Exists") ; go to next line FileWrite($file, @CRLF) FileClose($file) Exit EndIf |
AutoIT Example – FileExist checking and write to file for logging
Posted by John Sorensen on October 10th, 2009
Further Reading
- None Found


Posted in
Tags: