File information
Created by
DeathWrenchUploaded by
DeathWrenchVirus scan
About this mod
Run this before you start your game, or after and you will be able to press ALT F4 at any time to forcefully close the game immediately. It's a .ahk (Autohotkey) script, but I compiled it to .exe for people who don't want to install it. It can be set up to run with the game. Version that has a GUI with customize-able settings.
- Permissions and credits
4.0 versions had a major bug that broke mod managers and has been fixed in 5.0. I highly suggest you update to 5.0 if you were one of the unfortunate few who downloaded it.
The bug: In 4.0, if you used this on any game you were managing with a mod manager, you would have to restart your computer for the mod manager to be able to manage the game. It was such a bad bug that I have since removed all 4.0 files and images containing the code.
Autohotkey script to forcefully close the game when you press alt+f4.
For the .ahk version you need autohotkey. I compiled the script to .exe for those who don't want to install it.
Run the file, and click save to generate a .ini file that the script can read from. The menu will close but be active in the background. Press F10 (by default) to re-open the menu. (
Force Close: This is the keybind that gets used, by default it is ALT+F4 but you can change it to anything you'd like.
Open GUI: This is the keybind responsible for opening the Alt F4 menu.
Alt F4 - Basic Version 5.0 Usage:
You can get SLEA to open and close this file everytime you launch the game:
1. Download SLEA
2. Drag and drop slea.exe and slea.ini to your FalloutNV folder.
3. Backup your FalloutNVLauncher.exe,
4. Rename slea.exe to FalloutNVLauncher.exe
5. Open slea.ini
6a. put the following if you're using .exe version of Alt F4 and save it.
[General]
ExecutableName=FalloutNV.exe
CommandLine=
InjectorName=Alt_F4.exe
6b. put the following if you're using the .ahk version of Alt F4 and save it.
[General]
ExecutableName=FalloutNV.exe
CommandLine=
InjectorName=Alt_F4.ahk
If you want to get SLEA to open more than one file. You can do the following:
Method 1:
We make SLEA open a batch file.
Note: that when you do this. You have to run from a .bat file; therefore, the processes will not close by themselves like when using the above method. Remove "/w" to automatically close the batch file after it runs the commands (Command prompt stays open until the programs closes if you run with /w)
6.c. Make a new file called "whatever_you_want.bat" without quotations and open it in notepad and put the following:
start /w /d "Filepath Goes Here" ExeNameGoesHere.exe
Here is a working example and what yours should look like mostly.
start /w /d "D:\SteamLibrary\steamapps\common\Fallout New Vegas" Alt_F4.ahk
start /w /d "D:\SteamLibrary\steamapps\common\Fallout New Vegas" Other_Program.exe
or if the files are in the same directory as the .bat you can put
start /w /d Alt_F4.ahk
start /w /d Other_Process.exe
OR
"%~dp0Alt_F4.ahk" /w
"%~dp0FILENAMEHERE.EXE" /w
6.d. Save the .bat file and put the following in slea.ini:
[General]
ExecutableName=FalloutNV.exe
CommandLine=
InjectorName=whatever_you_want.bat
Method 2:
Instead we run a batch file that opens SLEA.
You technically don't even have to edit the slea.ini with this method. With this you can just make a batch file that runs everything.
Optionally, perform steps 1 to 6.a/6.b and then perform step 6.c:
6.e. Inside your .bat file put the following:
start /w /d "D:\SteamLibrary\steamapps\common\Fallout New Vegas" FalloutNVLauncher.exe
start /w /d "Filepath Goes Here" ExeNameGoesHere.exe
OR
start /w steam://rungameid/22380
start /w /d "Filepath Goes Here" ExeNameGoesHere.exe
OR
"%~dp0FalloutNVLauncher.exe" /w
"%~dp0FILENAMEGOESHERE.EXE" /w
Method 3
Functionality wise this batch file does the same thing SLEA does. (closes anything it runs after it can't detect the game anymore but it doesn't skip the launcher.)
I'm not going to give a tutorial for this one. At this point, you should be able to figure it out. @REM are comments to help a little. raise value "6" higher if the game doesn't start before the batch file executes causing the batch file to close everything it just opened along with itself.
start /w steam://rungameid/22380
start "" "Alt_F4.ahk"
@REM start "filepathhere" "thingyouwanttorunwithextension.exe"
:TEST
timeout /T 6
tasklist /FI "IMAGENAME eq FalloutNV.exe" 2>NUL | find /I /N "FalloutNV.exe">NUL
if "%ERRORLEVEL%"=="0" goto ACTIVE
:DEAD
taskkill /f /im Autohotkey.exe
@REM taskkill /f /im ExeNameGoesHere.exe
exit
:ACTIVE
goto TEST
a chunk of this batch file was taken from here
7. You're done! Now when you launch the game with steam or from the launcher. SLEA will run this script, and close it when the game is closed so you don't have to do anything and can close the game really fast.