CMD, PowerShell, Shutdown PC, Restart PC & Lock PC In The Context Menu.

EanB...n5vb
31 Jul 2025
83


"Laziness is a superpower. Do as little as possible to achieve as much as possible. I'd rather spend 2 minutes automating something than 2 seconds doing it manually. Because then I do it 100 times... and meanwhile, I still do nothing." - Someone who learned to be lazy... and love it.


The "existential crisis" came when I stepped away from the computer for a few moments to make some coffee. When I came back, to my surprise, Windows was updating (yes, AGAIN). When it finished, everything was working... until it didn't. A permissions error. A simple "Access Denied" in PowerShell. I needed to run some scripts, but no matter how many times I opened them, PowerShell refused to cooperate. I was in standard mode, needed administrator permissions, and to be in the correct folder. So I did what millions of people do every day (the usual):


  • 1. Search for "PowerShell" in the Start menu.
  • 2. Right-click.
  • 3. Select "Run as administrator".
  • 4. Type `cd` + the full path (which, obviously, I had to copy from another window).
  • 5. Run the command.


Total: 2-3 minutes. Do I really have to do this every time? Why doesn't Microsoft make it the default? Good question, maybe they think normal users are scared off by "CMD" or "PowerShell." The reality: this omission is a crime against productivity. Fortunately, Windows (in its infinite wisdom) lets us fix its mistakes, so let's change the rules of the game.


On many occasions, I let myself be carried away by The Philosophy of the Efficient Lazy Person: "I'm not lazy, I'm strategically inactive". Because it's not just about saving a few seconds; it's about "reducing mental friction". Every time you interrupt your flow to do something repetitive, you lose focus and time, which in certain environments is your greatest asset.


It's time to take control of the context menu. Many people know that you can customize the Windows 11 context menu to include CMD and PowerShell as administrator directly in the folder where you're working. You don't need third-party software, it won't break your system, just create a ".reg" file and a few minutes of your time.


How it works (without unnecessary technicalities). Windows allows you to modify its behavior through the system registry. It's like the internal "brain" of the operating system. All the settings are stored there, from the desktop background to how the menu responds to right-clicking. By adding specific keys to the registry, you can tell Windows: "When the user right-clicks on a folder background, show them the option to open CMD or PowerShell as administrator and take them directly to this location".


The solution is to create a ".reg" file that does everything for you and adds to the context menu: CMD and PowerShell (as administrator), plus Shutdown PC, Restart PC, and Lock PC. It will work in folders and the desktop. CMD and PowerShell will always open in the correct path, without having to navigate manually. It's reversible (you can delete it whenever you want) and doesn't install additional software. It's also 100% free and safe (if done correctly).


STEPS:

1. Open Notepad.

2. Copy and paste the code.


--------------✂️

Windows Registry Editor Version 5.00
; ============================
; === CMD As Administrator ===
; ============================
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCMDAdmin]
@="CMD As Administrator"
"Icon"="%SystemRoot%\\System32\\cmd.exe,0"
"runas"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCMDAdmin\command]
@="cmd.exe /s /k pushd \"%V\""
; ===================================
; === PowerShell As Administrator ===
; ===================================
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenPSAdmin]
@="PowerShell As Administrator"
"Icon"="%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe,0"
"runas"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenPSAdmin\command]
@="powershell.exe -windowstyle hidden -Command \"Start-Process powershell -ArgumentList 'cd %V' -Verb runAs\""
; ===================
; === Shutdown PC ===
; ===================
[HKEY_CLASSES_ROOT\Directory\Background\shell\ShutdownPC]
@="Shutdown PC"
"Icon"="shell32.dll,27"
[HKEY_CLASSES_ROOT\Directory\Background\shell\ShutdownPC\command]
@="shutdown /s /t 0"
; =================
; === Reboot PC ===
; =================
[HKEY_CLASSES_ROOT\Directory\Background\shell\RestartPC]
@="Reboot PC"
"Icon"="shell32.dll,176"
[HKEY_CLASSES_ROOT\Directory\Background\shell\RestartPC\command]
@="shutdown /r /t 0"
; ====================
; === Lock session ===
; ====================
[HKEY_CLASSES_ROOT\Directory\Background\shell\LockPC]
@="Lock Session"
"Icon"="shell32.dll,47"
[HKEY_CLASSES_ROOT\Directory\Background\shell\LockPC\command]
@="rundll32.exe user32.dll,LockWorkStation"
; ===========================================================
; ===========================================================
; === We Repeat EVERYTHING For The Desktop (just in case) ===
; ===========================================================
; ===========================================================
[HKEY_CLASSES_ROOT\DesktopBackground\shell\OpenCMDAdmin]
@="CMD As Administrator"
"Icon"="%SystemRoot%\\System32\\cmd.exe,0"
"runas"=""
[HKEY_CLASSES_ROOT\DesktopBackground\shell\OpenCMDAdmin\command]
@="cmd.exe /s /k pushd \"%V\""
[HKEY_CLASSES_ROOT\DesktopBackground\shell\OpenPSAdmin]
@="PowerShell As Administrator"
"Icon"="%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe,0"
"runas"=""
[HKEY_CLASSES_ROOT\DesktopBackground\shell\OpenPSAdmin\command]
@="powershell.exe -windowstyle hidden -Command \"Start-Process powershell -ArgumentList 'cd %V' -Verb runAs\""
[HKEY_CLASSES_ROOT\DesktopBackground\shell\ShutdownPC]
@="Shutdown PC"
"Icon"="shell32.dll,27"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\ShutdownPC\command]
@="shutdown /s /t 0"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\RestartPC]
@="Reboot PC"
"Icon"="shell32.dll,176"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\RestartPC\command]
@="shutdown /r /t 0"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\LockPC]
@="Lock Session"
"Icon"="shell32.dll,47"
[HKEY_CLASSES_ROOT\DesktopBackground\shell\LockPC\command]
@="rundll32.exe user32.dll,LockWorkStation"
--------------✂️

3. Save the file as "xxxx.reg" (or whatever you want).

4. Then double-click the file.

5. Say "Yes" to Windows when prompted.

6. Done!


Now, right-click on any empty space in a folder or on the desktop and you'll see:

  • CMD As Administrator
  • PowerShell As Administrator
  • Shutdown PC
  • Restart PC
  • Lock PC


What if something goes wrong? Relax, this doesn't break anything, install viruses, or change your wallpaper to a picture of Bill Gates staring at you. If you want to undo it, create another ".reg" file, copy and paste the code, run it, and everything will be back to normal, as if nothing ever happened.


--------------✂️

Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenCMDAdmin]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenPSAdmin]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\ShutdownPC]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\RestartPC]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\LockPC]
[-HKEY_CLASSES_ROOT\DesktopBackground\shell\OpenCMDAdmin]
[-HKEY_CLASSES_ROOT\DesktopBackground\shell\OpenPSAdmin]
[-HKEY_CLASSES_ROOT\DesktopBackground\shell\ShutdownPC]
[-HKEY_CLASSES_ROOT\DesktopBackground\shell\RestartPC]
[-HKEY_CLASSES_ROOT\DesktopBackground\shell\LockPC]

--------------✂️


Microsoft, with all its power, gave us Windows 11... and took away the clean context menu. But as you can see, laziness is the mother of innovation. You don't need to be an expert; all it takes is a ".reg" file and the determination to never waste time again. This trick won't change the world, but it will change your workflow, and maybe, like me, it will give you a little more time to do what really matters: NOTHING 😎


The uncomfortable truth, which we struggle to admit, is that most of us are functional lazy people. Don't deny it. You too hate having to: Open the task manager to kill a process | Navigate through 5 folders just to run a ".bat" | Type commands you already know by heart but have to type them over and over again, and so on, ad infinitum. And it's not that we're lazy; on the contrary, we're very efficient by instinct. Our brain says: This should be easier... AND IT'S RIGHT.

OTHER LINKS OF INTEREST:

📈 Zaffex Broker + 🤖 GPTrading [+ 💲5 Bonus] - One of the easiest ways to make money | Cryptocurrencies by automatically optimizing your trading operations with Artificial Intelligence. You won't have to worry about investment strategies anymore, let technology work for you and receive an initial bonus of 💲5 to boost your operations. 👍


✍️ Tutorial: 🚀 Set up GPTrading BOT + Zaffex Broker + $5 (USDT) Bonus. 🤖 Automate your trading with GPTrading. 💸 Your success can start here.


https://youtu.be/XjS6ijIPP_A?si=rGz6BEEJ3gTIJZkw


🎯 REMEMBER: Trading is something anyone can do, but it's not for everyone. 💲 Investing in financial assets involves risk and can lead to losses if you don't trade with discipline and knowledge. Always trade responsibly and define your risk profile before starting.

BULB: The Future of Social Media in Web3

Learn more

Enjoy this blog? Subscribe to CryptoEntrepreneurs

0 Comments