The primary safety stair out on whatever operating arrangement is the privileges. This agency that the execution of whatever physical care for or exactly a programme tin hold out done at diverse stages. Mostly, this conclusion is taken tending of yesteryear the operating arrangement itself because it is the supreme ascendency to practice so. But sometimes, running too thence add-on scripts or programs require higher privileges. This is due to the fact that these programs necessitate an access to arrangement files too APIs that are embedded into the operating arrangement too alone the higher ascendency inwards the privileges hierarchy to receive got an access to. This is unremarkably the Administrator. Similarly, users oftentimes receive got an final result running the PowerShell scripts equally an administrator. Because this is a whole lot large procedure. So, nosotros volition hold out adding an selection Run equally Administrator to the PS1 File Context Menu.
Add Run equally Administrator to PS1 File Context Menu
Please practice a arrangement restore request earlier commening. Having done this, offset yesteryear opening Registry Editor. To practice this, search for regedit in Cortana Search Box or hitting WINKEY + R push clit combo to launch Run too type regedit and hitting Enter.
Now navigate to the next path,
HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\shell
Now, right-click on left side panel. Hover too Select New > Key.
Now rename it to RunAs.
Under it, practice a novel String yesteryear right-clicking on the correct side panel too clicking on String.
Name that novel string at HasLUAShield. Select Yes to whatever UAC or User Account Control prompts.
Under the Run key, practice around other fundamental too advert it command.
Inside it, you lot volition notice a default subkey named as Default.
Right-click too modify it too sets it’s Value Data to this,
powershell.exe "-Command" "if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'"
Finally, Reboot your computer.
Now afterward it boots, cheque if you lot tin locomote whatever PowerShell script amongst Administrator privileges from the right-click context menu.
How to undo all these changes
In club to undo these changes, navigate to the next path,
HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\shell
Now, delete the subkey named as RunAs.
Reboot your computer.
Use our readymade files
Alternatively, you lot tin exactly role the Add Run As Administrator PS.reg file that nosotros created for your role too skip all the instructions above. Double click on it to locomote it. Now, inwards club to Merge it, hit Yes for all the prompts that you lot croak including the UAC prompt. Reboot your computer.
To undo the changes, double-click on the Remove Run As Administrator PS.reg file too reboot the changes.
You tin download the files from our servers yesteryear clicking here.
Source: https://www.thewindowsclub.com/
comment 0 Comments
more_vert