When you right-click on a file or folder in Windows, you may have noticed an option called "Open With" in the context menu. This option allows you to choose which application to use when opening the selected file or folder. However, sometimes you may need to run the chosen application with administrative privileges. In this article, we will explain how to run an app with admin privileges when invoked by the "Open With" option in the context menu.
Before we begin, please note that this method requires you to have administrative access to your computer. If you don't have the necessary permissions, you may need to contact your system administrator or the person responsible for managing your computer.
Step 1: Locate the Application
The first step is to locate the application you want to run with admin privileges. This can be any executable file (usually ending with the .exe extension) or a shortcut to an application.
Step 2: Create a Shortcut
Next, we need to create a shortcut for the application. To do this, right-click on the application and select "Create Shortcut" from the context menu. This will create a new shortcut file in the same location as the original application.
Step 3: Edit the Shortcut Properties
Now, right-click on the newly created shortcut and select "Properties" from the context menu. In the properties window, go to the "Shortcut" tab.
In the "Target" field, you will see the path to the application. At the end of the path, add a space followed by /runas. This will tell Windows to run the application with admin privileges when invoked by the "Open With" option.
For example, if the original target path is:
C:\Program Files\ExampleApp\example.exe
The modified target path should be:
C:\Program Files\ExampleApp\example.exe /runas
Once you have made the necessary changes, click "OK" to save the shortcut properties.
Step 4: Test the Shortcut
Now, right-click on any file or folder and select "Open With" from the context menu. In the "Open With" menu, click on "Choose another app" if the desired application is not listed. Then, click on "More apps" to expand the list of available options.
Scroll down and select "Look for another app on this PC." This will open a file explorer window. Navigate to the location where you saved the modified shortcut and select it.
If everything is set up correctly, the chosen application should now open with admin privileges. You may be prompted to enter your administrator password or confirm the action.
Remember, running an application with admin privileges gives it elevated permissions, which can be potentially dangerous if used incorrectly. Always make sure you trust the application and its source before running it with admin privileges.
Conclusion
By following the steps outlined in this article, you can run an app with admin privileges when invoked by the "Open With" option in the context menu. This can be useful when you need to perform certain tasks that require administrative access. However, exercise caution and only run applications with admin privileges from trusted sources.
| Reference | Link |
|---|---|
| Microsoft Support: Create a shortcut | https://support.microsoft.com/en-us/windows/create-shortcuts-for-apps-files-folders-and-web-pages-9b6f0b5a-1f9d-714d-5f02-1a536cb2f0c1 |
| Microsoft Support: Run an app as administrator | https://support.microsoft.com/en-us/windows/run-an-app-as-administrator-ebba7219-8e94-7d2a-c589-7b675ce78598 |