I've been trying to create a script that lets me right-click on any folder or location in the navigation pane on Windows 10 Home and select an option to open PowerShell as an administrator right from there. I tested this prompt on Gemini 2.5 and Claude Sonnet 3.7, but only ChatGPT managed to solve it, and that was on the second attempt. Can anyone guide me on how to achieve this?
2 Answers
Your prompt might be a bit confusing, but it definitely leads to interesting results with AI. It shows how these models can adapt even with unclear instructions. Just keep in mind that sometimes breaking it down into simpler steps can help!
Claude responded to me right away with a script to add ‘Open elevated PowerShell window’ to my right-click context menu. Here’s a quick version of the BAT file it generated; just remember to run it as an admin:
```bat
@echo off
echo Adding "Open PowerShell window here as Administrator" to the right-click menu...
reg add "HKCRDirectoryshellOpenElevatedPowerShell" /ve /t REG_SZ /d "Open PowerShell window here as Administrator" /f
... (additional registry commands here)
echo Now you can right-click on any folder or drive!"
pause
```
It's pretty neat; now I can easily access PowerShell without the usual hassle!
It sounds handy! Just remember that if your folder names have spaces, that can cause issues unless the script is carefully set up to handle it.
I actually think the concept is clear—it's just not super straightforward to implement. If you don't give the AI the breakdown it needs, it might struggle a bit, especially if spaces are involved in folder names.