This script allows you to set or unset an EXE file or multiple EXE files to run as Administrator. The script modifies the compatibility settings of the EXE file(s) to ensure they run with elevated privileges.

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name SetExeToRunAsAdmin

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More


Package Details


  • asherto


PowerShell Windows exe set run remove unset administrator add compatibility admin


Get-CompatibilityKey AddRunAsAdministrator Get-ExeFiles


This script has no dependencies.

Release Notes

- [Version 0.0.1] Initial Release.
- [Version 0.0.2] Fixed example.
- [Version 0.0.3] Added option to unset the exe to run as Administrator and refactored function code.
- [Version 0.0.4] Fixed bug in version specification and improved examples.
- [Version 0.0.5] Added project link and improved tags.
- [Version 0.0.6] Fixed version specification.
- [Version 0.0.7] Final version specification fix.
- [Version 0.0.8] Improved description.
- [Version 1.0] Added RegJump option. Removed patch from version specification.
- [Version 1.1] Added support to detect if UnsetInstead doesn't exist. Optimized code.
- [Version 1.2.0] Improved parameter usage. Added checks for invalid commands. Improved examples. Optimized code. Added back patch in version specification.


Version History

Version Downloads Last updated
1.2.0 (current version) 80 6/17/2023
1.1 7 6/17/2023
1.0 6 6/17/2023
0.0.8 65 9/3/2022
0.0.7 11 9/3/2022
0.0.6 11 9/3/2022
0.0.4 10 9/3/2022
0.0.3 12 9/3/2022
0.0.2 38 7/6/2022
0.0.1 12 7/6/2022
Show more