


Inilah cara saya menggunakan autohotkey untuk memperbaiki kelemahan terburuk Windows 11
Jul 12, 2025 am 06:03 AMHow 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.
Atas ialah kandungan terperinci Inilah cara saya menggunakan autohotkey untuk memperbaiki kelemahan terburuk Windows 11. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!

Alat AI Hot

Undress AI Tool
Gambar buka pakaian secara percuma

Undresser.AI Undress
Apl berkuasa AI untuk mencipta foto bogel yang realistik

AI Clothes Remover
Alat AI dalam talian untuk mengeluarkan pakaian daripada foto.

Clothoff.io
Penyingkiran pakaian AI

Video Face Swap
Tukar muka dalam mana-mana video dengan mudah menggunakan alat tukar muka AI percuma kami!

Artikel Panas

Alat panas

Notepad++7.3.1
Editor kod yang mudah digunakan dan percuma

SublimeText3 versi Cina
Versi Cina, sangat mudah digunakan

Hantar Studio 13.0.1
Persekitaran pembangunan bersepadu PHP yang berkuasa

Dreamweaver CS6
Alat pembangunan web visual

SublimeText3 versi Mac
Perisian penyuntingan kod peringkat Tuhan (SublimeText3)

Topik panas

Penceramah tanpa wayar sepenuhnya, seperti Anker Soundcore 2, boleh menjadi pilihan yang munasabah untuk dipasangkan dengan telefon dan komputer riba. Mereka biasanya boleh menarik kuasa melalui USB, yang membolehkan mereka digunakan berwayar. Walau bagaimanapun, output kuasa terhad mereka juga bermaksud bahawa mereka tidak g

Dalam banyak cara, tidak masuk akal untuk saya menggunakan papan kekunci tanpa wayar dengan PC pegun saya. Bukan sahaja papan kekunci saya tidak pernah bergerak, tetapi saya cenderung untuk menyimpan penerima 2.4 GHz yang duduk di atas meja saya melalui dongle yang dilampirkan pada kabel. Selanjutnya, papan kekunci saya memerlukan r

Microsoft telah membuat perubahan kepada hampir setiap bahagian Windows 11 sejak pelancaran awalnya pada tahun 2021, tetapi menu bar tugas dan permulaan masih tidak disentuh -sehingga sekarang. Reka bentuk menu permulaan segar di kaki langit, dan mungkin satu yang anda suka. Ini

Pemain PC telah berurusan dengan isu -isu ini selama beberapa dekad sekarang, kerana Windows telah dan kekal sebagai sistem operasi lalai untuk pemain PC. Walau bagaimanapun, terima kasih kepada Valve dan SteamOS, serta pengagihan Linux yang berpusatkan permainan seperti Bazzite, Microso

Jika anda ingin membatalkan log masuk kata laluan untuk Windows 11, terdapat tiga kaedah untuk dipilih: 1. Ubah suai tetapan log masuk automatik, hapuskan "untuk menggunakan komputer ini, pengguna mesti memasukkan nama pengguna dan kata laluan mereka", dan kemudian mulakan semula log masuk automatik selepas memasukkan kata laluan; 2. Beralih ke kaedah log masuk tanpa kata laluan, seperti pin, cap jari atau pengenalan muka, konfigurasikannya dalam "Tetapan> Akaun> Pilihan Log masuk" untuk meningkatkan kemudahan dan keselamatan; 3. Padam kata laluan akaun secara langsung, tetapi terdapat risiko keselamatan dan boleh membawa kepada beberapa fungsi yang terhad. Adalah disyorkan untuk memilih penyelesaian yang sesuai berdasarkan keperluan sebenar.

Seperti banyak pengguna Windows, saya sentiasa mencari cara untuk meningkatkan produktiviti saya. Palet Perintah dengan cepat menjadi alat penting bagi saya. Utiliti yang kuat ini telah mengubah sepenuhnya bagaimana saya berinteraksi dengan Windows, memberi saya akses segera ke

Untuk menjalankan program sebagai pentadbir, anda boleh menggunakan fungsi Windows sendiri: 1. Klik kanan menu untuk memilih "Run As Administrator", yang sesuai untuk senario kenaikan keistimewaan sementara; 2. Buat jalan pintas dan periksa "Run sebagai Pentadbir" untuk mencapai permulaan kenaikan keistimewaan automatik; 3. Gunakan penjadual tugas untuk mengkonfigurasi tugas automatik, sesuai untuk menjalankan program yang memerlukan keizinan pada asas yang dijadualkan atau latar belakang, perhatikan untuk menetapkan butiran seperti perubahan jalan dan cek kebenaran.

Windows 10 KB5061087 kini dilancarkan sebagai kemas kini pratonton pilihan untuk mereka pada versi 22H2 dengan pembetulan menu Mula.
