Hello,
With AutoHotkey we’re often automating programs, however there are times where we have local files that we want to read. There are several ways to do this in AutoHotkey however in this video (that I extracted from Intro to AutoHotkey) I demonstrate using the FileWrite command.
I demonstrate using UTF-8 encoding which is a great default to use for most of your scripts.
I also show how to use FileExist command to check if a file exists.
You can use those commands to read the contents of a file and then operate on them. Maybe you want to replace some words, or append data to the file and then save it again.
Many times you want to make decisions in your script depending on whether a file exists or not.
For example: You might want to check if your settings.ini file exists or not. If it doesn’t exist, then you want to create a file with the default settings.
In our Intermediate AHK v2 course we touch on many interesting situations that we find in which you can use file manipulation techniques. Click here to get a 15% discount!
Additional Resources
- AddRequires is a tool that is a good example of when to use the FileRead and FileWrite commands.
Joe, Isaias, Irfan & Team
This campaign was designed to allow you to jump around. At any time you can jump to any one of the emails by clicking below
P.S. Reading/Writing files is a common topic in our AHK Hero meeting calls. Remember that if you are member, you get a 25% discount to all our courses❗

