Windows 10: Add or remove Run as Administrator to PS1 File Context Menu in Windows 10

Discus and support Add or remove Run as Administrator to PS1 File Context Menu in Windows 10 in Windows 10 News to solve the problem; [ATTACH] The main security measure on any operating system is the privileges. This means that the execution of any process or simply a program can be... Discussion in 'Windows 10 News' started by WinClub, Jul 26, 2018.

  1. WinClub New Member

    Add or remove Run as Administrator to PS1 File Context Menu in Windows 10

    WinClub, Jul 26, 2018
    #1
  2. Brink Win User
    Brink, Jul 26, 2018
    #2
  3. Lmbrt Win User
    On how to run a .ps1 file as Administrator


    Hello everyone,

    If you have had a chance of going through the great Brink's Tutorial Apps - Uninstall in Windows 10 (I strongly advice you do), you may have noticed that, if you wish to automatize, at least to a certain extent, the procedure of getting rid of Windows 10 pre-installed bloatware (sorry, Apps would sound much better), you will inescapably bump into the need of creating a tailored .ps1 file.

    More specifically, you may want to copy and paste into a text editor like Notepad your customized set of instructions and then saving it with the extension .ps1 rather than .txt (or, which is the same, save it as a .txt file and then, disregarding Windows warnings, change its extension to .ps1)

    I hope an example might help. Let us assume I wish to uninstall, for instance, Alarms & Clock, Calendar and Mail, Candy Crush Soda Saga and Microsoft Solitaire Collection for all users. IMHO your file should be like this:

    Get-appxpackage -allusers *windowsalarms* | Remove-AppxPackage
    Get-appxpackage -allusers *windowscommunicationsapps* | Remove-AppxPackage
    Get-appxpackage -allusers *CandyCrushSodaSaga* | Remove-AppxPackage
    Get-appxpackage -allusers *solitairecollection* | Remove-AppxPackage

    So far so good, copy and paste all of the above into Notepad, save it as a .ps1 file and everybody's content. Apart from the fact that when you launch it with PowerShell, which is the final purpose of the whole iteration, it inevitably crashes due to the fact that, apparently, for these kind of instructions you need Administraor's privileges. That is, to be even more clear, those privileges you get when you right-click on PowerShell in Menu and select Run as Administrator.

    Which brings us to the question: how do I run a .ps1 file in PowerShell as Administrator? *Confused

    Kindly note that I am logged in my PC's as Administrator (single user, as a matter of fact).

    Thank you all in advance. *Smile
     
    Lmbrt, Jul 26, 2018
    #3
  4. Add or remove Run as Administrator to PS1 File Context Menu in Windows 10

    Add or Remove Run as administrator Context Menu in Windows 10


    This didn't work for me. Sometime after upgrading to the Windows 10 Anniversary update I noticed Run as Administrator was missing from the right-click context menu. (I've also installed the Take Ownership reg hack which may be related?)

    I also couldn't open an elevated DOS prompt. When I clicked shift right-click on the Start button and selected Command Prompt (Admin) a DOS window would pop open for a split second and then close, with no error indication.

    One other strange thing that's been happening since the upgrade is Windows Explorer 'unexpectedly' stops and restarts several times a day. Sometimes on its own and sometimes when I click on a file or try to open the file in a program.

    After installing your Run as Administrator .REG, it still does not show up on my context menu, but I see that opening an elevated DOS prompt now works. Thanks for fixing that at least. *Smile I can still open a program as Administrator if I press Shift then right-click and Run as a Different User and give the Administrator name and password.

    Any suggestion for how to get Run as Administrator back into my Context Menu?

    Thanks,
    Larry
     
    Wrightclick, Jul 26, 2018
    #4
Thema:

Add or remove Run as Administrator to PS1 File Context Menu in Windows 10

Loading...
  1. Add or remove Run as Administrator to PS1 File Context Menu in Windows 10 - Similar Threads - Add remove Run

  2. How to Add "Run as administrator" to Context Menu of MSI Files in W10

    in Windows 10 Software and Apps
    How to Add "Run as administrator" to Context Menu of MSI Files in W10: Run as administrator - Add to MSI File Context Menu - Windows 7 Help Forums Is this still applicable for windows 10? I have not yet attempted to do this. In my Downloads folder there are right click options to Install / Repair / Uninstall the LibreOffice installation...
  3. Run as different user - Add or Remove Context Menu in Windows 10

    in Windows 10 Tutorials
    Run as different user - Add or Remove Context Menu in Windows 10: How to: Run as different user - Add or Remove Context Menu in Windows 10 How to Add or Remove 'Run as different user' Context Menu in Windows 10 [img] Information The Run as different user context menu allows a user to run .bat, .cmd, .exe, .msc, and .msi files with...
  4. On how to run a .ps1 file as Administrator

    in Windows 10 Support
    On how to run a .ps1 file as Administrator: Hello everyone, If you have had a chance of going through the great Brink's Tutorial Apps - Uninstall in Windows 10 (I strongly advice you do), you may have noticed that, if you wish to automatize, at least to a certain extent, the procedure of getting rid of Windows 10...
  5. Add 'Run with priority' Context Menu in Windows 10

    in Windows 10 Tutorials
    Add 'Run with priority' Context Menu in Windows 10: How to: Add 'Run with priority' Context Menu in Windows 10 How to Add 'Run with priority' Context Menu in Windows 10 [img] Information Windows shares processor resources between all running processes based upon their priority level. If a process (application) has a...
  6. Add or Remove Run as administrator Context Menu in Windows 10

    in Windows 10 Tutorials
    Add or Remove Run as administrator Context Menu in Windows 10: How to: Add or Remove Run as administrator Context Menu in Windows 10 How to Add or Remove 'Run as administrator' Context Menu in Windows 10 Some legitimate applications require a full administrator access token (elevated) to perform their functions or tasks. For...
  7. Add or Remove Open with Context Menu to URL files in Windows 10

    in Windows 10 Tutorials
    Add or Remove Open with Context Menu to URL files in Windows 10: How to: Add or Remove Open with Context Menu to URL files in Windows 10 How to Add or Remove Open with Context Menu to URL files in Windows 10 A .url file is an Internet shortcut that opens with your default web browser. The Open with context menu allows you to choose...
  8. Run as administrator - Add to PS1 File Context Menu in Windows 10

    in Windows 10 Tutorials
    Run as administrator - Add to PS1 File Context Menu in Windows 10: How to: Run as administrator - Add to PS1 File Context Menu in Windows 10 How to Add 'Run as administrator' to PS1 File Context Menu in Windows 10 Some legitimate applications require a full administrator access token (elevated) to perform their functions or tasks. For...
  9. Add Run as administrator to Context Menu of MSI Files in Windows 10

    in Windows 10 Tutorials
    Add Run as administrator to Context Menu of MSI Files in Windows 10: How to: Add Run as administrator to Context Menu of MSI Files in Windows 10 How to Add 'Run as administrator' to MSI File Context Menu in Windows 10 [img] Information Some legitimate applications require a full administrator access token (elevated) to perform their...
  10. Add Run as administrator to Context Menu of VBS Files in Windows 10

    in Windows 10 Tutorials
    Add Run as administrator to Context Menu of VBS Files in Windows 10: How to: Add Run as administrator to Context Menu of VBS Files in Windows 10 How to Add 'Run as administrator' to VBS File Context Menu in Windows 10 [img] Information Some legitimate applications require a full administrator access token (elevated) to perform their...