Skip to content

Make Shortcuts "Run as Admin" AND/OR Open with Certain Applications

Published: at 04:26 AM

In Windows, you can create shortcuts to run programs as an administrator or to open specific files with certain applications. Below are instructions and examples to create these shortcuts.

Creating Shortcuts to “Run as Admin”

To create a shortcut that always runs a program as an administrator, follow these steps:

  1. Right-click on the desktop or in a folder and choose New > Shortcut.

  2. In the Location field, type the path to the application, followed by the necessary parameters (if applicable).

    • Example for Notepad++ opening the hosts file:
      "C:\Program Files (x86)\Notepad++\notepad++.exe" "c:\windows\system32\drivers\etc\hosts"
      
    • Example for Microsoft Visual Studio:
      "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe"
      
  3. Click Next, give the shortcut a name (e.g., Notepad++ as Admin), and click Finish.

  4. Right-click the shortcut and select Properties.

  5. Under the Shortcut tab, click Advanced.

  6. Check the box for Run as administrator and click OK.

This will make the application always run with administrative privileges when the shortcut is used.

Creating Shortcuts to Open with Specific Applications

To open a specific file with a designated application, follow these steps:

  1. Right-click on the desktop or in a folder and choose New > Shortcut.

  2. In the Location field, enter the path to the application and the file you want to open.

    • Example for opening hosts file with Notepad++:
      "C:\Program Files (x86)\Notepad++\notepad++.exe" "c:\windows\system32\drivers\etc\hosts"
      
  3. Click Next, name the shortcut (e.g., Open hosts with Notepad++), and click Finish.

  4. The shortcut will now open the hosts file directly with Notepad++ when clicked.

Additional Notes

These shortcuts can streamline workflows and ensure that certain applications are always run with elevated privileges or specific files are opened with preferred programs.


Previous Post
MSSQL Over LAN
Next Post
Android-x86 as an Emulator in Hyper-V