Plus, a look at the risks
What is an executable file? An executable file is a program file that can be run, with a set of instructions or options to make it do something on your PC. Executable files are found on almost all modern operating systems, but most people will associate them with the Windows EXE file format.
You’ll usually see an EXE file when you install new software or run a program on your PC, where the EXE extension is used. If you’re creating your own software, you can even create your own executable file to run, install, or distribute. If you’re interested in learning more about executable files and how to create an executable file, here’s what you need to do.
The Risks Of Executable (EXE) Files
When you run an executable file, you give it permission to run the instructions held within it. That’s how any software works, from basic few-line scripts to complex software with millions of lines of code.
Before you run or make an executable file, you should be aware of the potential risks. Executable files have the potential to include instructions within the source code that could damage your PC.
It could tell your PC to delete other files, or it could instruct your PC to send information to an outside source. This is the definition of malware, created to cause harm at your expense.
Before you run any executable file, especially if it asks for administrative permissions in a User Account Control pop-up, you should scan the file for malware using Windows Security or your own third-party anti-malware software like Malwarebytes. You should also only install or run software from sources you absolutely trust.
If you’re creating your own software to run, you should make sure that the code isn’t designed to access any important files. While Windows will typically prevent unauthorized access to system files using UAC, double-check your code before you run it to make sure the software can’t harm your PC.
Opening Executable (EXE) Files On Windows
If you want to open an executable file on Windows, you can do so in a few ways. Windows automatically recognizes the EXE file format as an executable file, so you can typically open it from your desktop, from Windows File Explorer, using the Windows Start menu (for installed software), or by using the Run command box.
- To open EXE files on your desktop or in Windows File Explorer, double-click on the file. This will instruct Windows to open it.
- The list of installed software in the Windows Start menu are shortcuts to the EXE files for those software (for instance, Chrome.exe for Google Chrome). Press the Start menu icon (or hit the Windows key on your keyboard), then press one of the entries to run your software.
- To use the Run command box to run an EXE file, press the Windows key + R on your keyboard. Alternatively, right-click the Start menu icon and press the Run option.
- In the Run command box, locate your executable file by pressing Browse, or type the file location directly. When you want to run the EXE file, press OK.
- If the EXE file requests administrative access, you’ll need to allow it to run in the UAC pop-up. Press Yes to allow this.
- If the executable file can’t run (it may be designed for an older version of Windows, for instance), then Windows will stop it from running. You may also see an error message. If this happens, press Close and look for an alternative version of the file to run instead.
How To Create An Executable File On Windows
If you want to create your own executable files on Windows, you can, but it isn’t as simple as renaming a file and adding .exe to the end of it.
You’ll need to code the software you want to run in your chosen programming language, then compile it as a file that can be executed. Most users will want to create more basic executable files, however, such as installer files for software installations.
You could use the built-in IExpress Wizard to do this on Windows, but this software is very old and hasn’t been updated in some time. The better option is to use the open-source Inno Setup or, for basic self-extracting EXE files, you could use 7-Zip.
An EXE file created using 7-Zip is actually an SFX archive file. This archive file, appearing with the EXE file format, will automatically extract any included files onto your PC, making it perfect for simple software deployments.
If you want to share files to multiple users without having to worry about them having the right software installed, creating a file like this would be a good option.
- To create an EXE file using 7-ZIP, place your files in a folder in Windows File Explorer. Right-click the folder, then press 7Zip > Add to archive.
- In the Options box, click the Enable SFX Archive checkbox. You’ll also want to set the Archive Format to 7z, the Compression Method to LZMA2, and the Compression Level to Normal. Press OK to create the file.
While this isn’t a true EXE file, it looks and acts like one, making it an easy way to create an executable file that can distribute software or files you’ve created with others.
Otherwise, if you want to create a “real” executable file, you’ll need to learn how to program.
Running Executable Files On Mac Or Linux
The way executable files work on Windows is entirely different to the way that programs run on other platforms, like Linux or macOS. These platforms do have executable files, but they aren’t in the EXE file format.
On Linux, for instance, any file can be executable, but it requires a special file permissions flag to run it as a program using chmod. The command chmod +x file would give a file named file the execute permission to run, for instance.
macOS has a slightly different method for running software. If the app hasn’t been installed from the App Store, and it isn’t from a developer it knows or trusts, then the app won’t be allowed to run. You’ll need to allow it in your System Preferences > Security & Privacy menu.
As a Unix-based system, however, macOS does support the chmod command, allowing you to execute more basic scripts using the Terminal app. If you developed a Python script, for instance, you could use the chmod +x command to run it.
You can also use the WINE emulator for Linux and macOS to run and install Windows EXE files on those platforms. Designed to emulate certain Windows instructions and libraries, using WINE to run an EXE file will have varying levels of success.
You can confirm how well popular software will run using WINE by checking the WineHQ database.
Running Executable Files On Windows 10
There’s nothing stopping you creating your own software, especially if you combine it with Windows installer packages to make it easy to install. For most Windows 10 users, however, EXE files are there to be run, not made. As long as you only run software from sources you trust, executable files should be relatively safe.
Make sure that you run malware scans regularly and, if you’re really unsure about whether an executable file is safe to run, you can use the Windows 10 sandbox mode to run software in an isolated container to test it out. If the EXE is dangerous, it won’t damage your main Windows installation.