How to Create and Run a Script in AutoHotkey
To start, you need to download AutoHotKey v2.0 and install it on your computer. Next, right-click an empty part of the desktop or File Explorer and select New > AutoHotkey Script.

Give the script a name and click the "Create" button. This creates a blank text file with an AHK extension. You can also use any text editor (e.g., Notepad, Notepad++, or Visual Studio Code) to create an AutoHotkey script.

Now, right-click the script and select Show more options > Edit Script. Paste the code you want to run into the text editor and save it by pressing Ctrl+S or clicking File > Save—these are the most common ways to save a file on Windows. Afterward, right-click the script and select "Open" in the menu. Alternatively, you can just double-click to run it.

You can verify the script is running by checking the system tray. Look for the AHK icon with the name of the file. If you need scripts to run after you boot up your PC, you can make them a startup program. Just place them in the "C:Users[User]AppDataRoamingMicrosoftWindowsStart MenuProgramsStartup" folder. Here, [User] is your Windows username.

How to Write a Batch Script on Windows
If you have a task you do repeatedly, writing a simple Batch file can save you a ton of time.
How I Use AutoHotKey to Improve My Windows Experience
Now that you are familiar with creating AHK scripts, let's look at some useful scripts I use to make the Windows experience more enjoyable.
Open Anything With a Shortcut
AHK allows you to open apps, files, or folders using global shortcuts. No need for multiple clicks through menus or the Start menu to access what you need.
Here is a script that opens Google Chrome using the Ctrl+Alt+G shortcut:
<code>; Launch Chrome^!g::Run "C:Program FilesGoogleChromeApplicationchrome.exe"</code>
Keep in mind that AutoHotkey will ignore any line of code that starts with a semicolon (;), as these are considered comments in the world of programming. The next line of code is what it will execute. Here ^ is Ctrl, ! is Alt, and g is, well, the G key. The double colons (::) separate the hotkey definition from the action to perform (Run "C:Program FilesGoogleChromeApplicationchrome.exe").
For more information on what the characters mean in the scripts, take a look at the AHK documentation.
You can customize the above script to suit your needs. For instance, you can replace g with another key. You can also replace the file path of Chrome with Asana's if that is what you want to open instead.
If you want to open multiple apps, files, and folders with a single shortcut, you can insert the code to run them inside angled brackets, like in the example below:
<code>^!g::{; Launch ChromeRun "C:Program FilesGoogleChromeApplicationchrome.exe"; Wait a second before launching the next appSleep 1000; Launch NotepadRun "notepad.exe"; Launch File ExplorerRun "explorer.exe"; You can add more applications as neededreturn}</code>
Without AHK, one way to achieve this is to use Power Automate for desktop to automate repetitive tasks. Using AHK in this instance is faster.
Quickly Search Google
If you see a word and want to Google search it, you have to open a browser, type it in, and hit the Enter key. Don't you wish Windows would allow you to highlight it and hit a few keys to do that? It's possible, but with AutoHotkey.
Here is the script to make that happen when you hit Ctrl+Shift+G:
<code>^+g::{Send, ^cSleep 50Run, <https:>Return}</https:></code>
The search results will open in your PC's default browser. If it opens a browser you don't use (e.g., Edge instead of Chrome), you can change your default browser on Windows with a few clicks.
An Easier Way to Insert Special Characters
There is no easy way to insert special characters on Windows without relying on the On-Screen Keyboard or opening a forgotten tool like the Character Map. But with AHK, you can assign them to custom shortcuts and insert them anywhere with ease.
Here is the AHK script that inserts the copyright symbol (?) when you press Alt+Q:
<code>!q::Send ?</code>
Insert Frequently Used Text Snippets
Have you ever found yourself typing the same phrases over and over again, and wish Windows could offer a way to do these tedious actions with shortcuts? Well, AutoHotkey is the solution, as it allows you to insert frequently used text snippets with just a few keystrokes.
Here is an example of a script that inserts by the way whenever you type btw followed by the Space key.
<code>::btw::by the way</code>
Although a little more complex, you can also insert multi-line text. For instance, this script can help if you're tired of writing the same email signature every time. Here is an example:
<code>:*:emailsig::{Send "Best regards,{Enter}John Doe{Enter}Email: johndoe@email.com{Enter}Phone: 555-123-4567"return}</code>
Now, whenever you enter emailsig while the script is running, it will insert the email signature. The {Enter} notation signifies where AHK will enter a new line, just like you would after typing part of the signature and pressing the Enter key.
Add AutoCorrect to Windows
I hate that Windows doesn't have a built-in autocorrect feature that works across all applications to correct those common and frustrating typos. Below is a script that can solve this problem:
<code>::teh::the::adn::and::recieve::receive::alot::a lot::thier::their::freind::friend::definately::definitely::seperate::separate</code>
You can expand that list with more words that you misspell frequently. Consider keeping a running list of your common typos to add to this script over time.

Can You Rely on Microsoft Word for Spelling and Grammar Corrections?
Let's see if you should trust Microsoft Word's spellchecker is up to the task.
1A Simple Text Case Converter
Another frustrating thing I constantly run into is that there just isn't any text case converter on Windows. If I want some text to be all in uppercase or vice versa after typing it in Notepad or Sticky Notes, I generally have to type it again. With a simple AHK script, I can instantly convert it with a shortcut.
The AHK script below turns all letters to uppercase when you press Ctrl+Shift+U and lowercase when Ctrl+Shift+L is pressed (make sure you highlight the text first):
<code>^+u::{ClipSaved := ClipboardAllClipboard := ""SendInput ^cClipWait 0.5StringUpper, Clipboard, ClipboardSendInput %Clipboard%Clipboard := ClipSavedReturn}^+l::{ClipSaved := ClipboardAllClipboard := ""SendInput ^cClipWait 0.5StringLower, Clipboard, ClipboardSendInput %Clipboard%Clipboard := ClipSavedReturn}</code>
Quickly Shutdown Windows
Shutting down your PC usually requires clicking Start > Power > Shutdown or long-pressing the power button. But with AHK, you can create a simple shortcut to start the shutdown process. This can be especially useful when you need to quickly power off your computer if you need to leave right away and don't have the time to navigate menus.
Here is a script that shuts down Windows immediately when you press Ctrl+Shift+End:
<code>^+End::{Run "shutdown.exe /s /t 0"return}</code>
And here's one for restarting your PC with Win+Shift+R:
<code>#+r::{ Run "shutdown.exe /r /t 0"return}</code>
Minimize All Windows Except the Active One
Ever need to focus on just one window and get rid of all the other clutter? You can minimize them all with the Win+M shortcut, but there isn't one for minimizing all windows except the one you're working with.
AutoHotkey can remedy that with the script below. It minimizes all windows except the active one when you press Win+Shift+M.
<code>#+m::{WinGetTitle, ActiveTitle, AWinMinimizeAllWinRestore, %ActiveTitle%return}</code>
If you find more than one script useful, you don't have to create a separate AHK file for it. You can combine all of them in one file, and it will execute them all (as long as the hotkeys don't conflict with each other).
These are all simple scripts, but they can get more advanced than this. If you want to dive deeper into AHK, there are plenty of resources online on top of the documentation, including tutorials, YouTube videos, and community forums.
The above is the detailed content of This Is How I Use AutoHotkey to Fix Windows 11's Worst Flaws. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

If you want to cancel the password login for Windows 11, there are three methods to choose: 1. Modify the automatic login settings, uncheck "To use this computer, users must enter their username and password", and then restart the automatic login after entering the password; 2. Switch to a passwordless login method, such as PIN, fingerprint or face recognition, configure it in "Settings>Account>Login Options" to improve convenience and security; 3. Delete the account password directly, but there are security risks and may lead to some functions being limited. It is recommended to choose a suitable solution based on actual needs.

Like many Windows users, I am always on the lookout for ways to boost my productivity. Command Palette quickly became an essential tool for me. This powerful utility has completely changed how I interact with Windows, giving me instant access to the

There are three main ways to uninstall programs on Windows 11: 1. Uninstall through "Settings", open the "Settings" > "Apps" > "Installed Applications", select the program and click "Uninstall", which is suitable for most users; 2. Use the control panel, search and enter "Control Panel" > "Programs and Functions", right-click the program and select "Uninstall", which is suitable for users who are accustomed to traditional interfaces; 3. Use third-party tools such as RevoUninstaller to clean up more thoroughly, but pay attention to the download source and operation risks, and novices can give priority to using the system's own methods.

To run programs as administrator, you can use Windows' own functions: 1. Right-click the menu to select "Run as administrator", which is suitable for temporary privilege hike scenarios; 2. Create a shortcut and check "Run as administrator" to achieve automatic privilege hike start; 3. Use the task scheduler to configure automated tasks, suitable for running programs that require permissions on a scheduled or background basis, pay attention to setting details such as path changes and permission checks.

Windows 10 KB5061087 is now rolling out as an optional preview update for those on version 22H2 with Start menu fixes.

This might not be at the top of the list of features people want to return from Windows 10, but it still offers some usefulness. If you'd like to view the current minutes and seconds without turning on that display in the main taskbar clock (where it

Microsoft confirmed that the DHCP server service might stop responding or refuse to connect after the June 2025 Update for Windows Server.

In the past, I always viewed the i5 lineup as anemic when it came to gaming. However, in 2025, a mid-range CPU is more than enough to start your gaming journey. Many games still don’t fully utilize multi-core performance as well as they could, so
