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:
-
Right-click on the desktop or in a folder and choose New > Shortcut.
-
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"
- Example for Notepad++ opening the
-
Click Next, give the shortcut a name (e.g., Notepad++ as Admin), and click Finish.
-
Right-click the shortcut and select Properties.
-
Under the Shortcut tab, click Advanced.
-
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:
-
Right-click on the desktop or in a folder and choose New > Shortcut.
-
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"
- Example for opening
-
Click Next, name the shortcut (e.g., Open hosts with Notepad++), and click Finish.
-
The shortcut will now open the
hosts
file directly with Notepad++ when clicked.
Additional Notes
- If you want a shortcut to open a program with specific parameters, make sure to place the executable path in quotes, followed by the file or parameters you want to pass to the program.
- You can follow similar steps to create shortcuts for other programs, like Visual Studio, to open specific files or projects directly.
- Running applications as an administrator ensures that you have the necessary permissions to modify system files and settings.
These shortcuts can streamline workflows and ensure that certain applications are always run with elevated privileges or specific files are opened with preferred programs.