03.11.2020

Running the program without administrator rights and suppressing the UAC prompt. Run any program as administrator Run a program that requires administrator rights from a regular user


Many programs require elevation at startup (the shield icon next to the icon), but in fact, for them normal work Administrator rights are not required (for example, you have manually granted the necessary rights to users for the program directory in ProgramFiles and the registry branches that are used by the program). Accordingly, when starting such a program from under simple user if User Account Control is enabled on the computer, a UAC prompt will appear and the user will be prompted for an administrator password. To bypass this mechanism, many simply disable UAC or grant the user administrator rights on the computer by adding him to the local administrators group. Naturally, both of these methods are unsafe.

Why a normal application might need administrator rights

The program may need administrator rights to modify certain files (logs, configurations, etc.) in its own folder in C: \ Program Files (x86) \ SomeApp). By default, users do not have rights to edit this directory, therefore, for the normal operation of such a program, administrator rights are required. To solve this problem, under the administrator at the NTFS level, manually assign the edit / write permission for the user (or the Users group) to the program folder.

Note... In fact, the practice of storing the changing application data in its own directory under C: \ Program Files is wrong. It is more correct to store application data in the user profile. But this is a question about the laziness and incompetence of the developers.

Running a program that requires administrator rights from a regular user

We have already described how it is possible using the RunAsInvoker parameter. However, this method is not flexible enough. It can also be used with the / SAVECRED admin password saved (also insecure). Let's consider an easier way to force launch of any program without administrator rights (and without entering the administrator password) with UAC enabled (4,3 or 2 levels).

For example, take the registry editing utility - regedit.exe(it is located in the C: \ windows \ system32 directory). When you run regedit.exe, a UAC window appears and if you do not confirm the elevation of privilege, the registry editor does not start.

Let's create a file on the desktop run-as-non-admin.bat with the following text:

cmd / min / C "set __COMPAT_LAYER = RUNASINVOKER && start" "% 1"

Now, to force the application to run without administrator rights and suppress the UAC prompt, just drag the desired exe file to this bat file on the desktop.

After that, the registry editor should start without a UAC prompt. Opening the process manager and add a column Elevated(With more high level permissions), you will see that there is a regedit.exe process on the system with a non-elevated status (launched with user rights).

Try to edit any parameter in the HKLM branch. As you can see, access to edit the registry in this branch is denied (for given user no permissions to write to the system registry branches). But you can add and edit keys in the user's own registry branch - HKCU.

Similarly, you can run through a bat file and specific application, it is enough to specify the path to the executable file.

run-app-as-non-admin.bat

Set ApplicationPath = "C: \ Program Files \ MyApp \ testapp.exe"
cmd / min / C "set __COMPAT_LAYER = RUNASINVOKER && start" "% ApplicationPath%"

You can also add a context menu that adds the ability to launch without elevation for all applications. To do this, create the following reg file and import it into the registry.

Windows Registry Editor Version 5.00


@ = "cmd / min / C \" set __COMPAT_LAYER = RUNASINVOKER && start \ "\" \ "% 1 \" \ ""

After that, to launch any application without admin rights, just select the "" item in the context menu.

__COMPAT_LAYER environment variable and RunAsInvoker parameter

The __COMPAT_LAYER environment variable allows you to set different compatibility levels for applications (tab Compatibility in properties exe file). Using this variable, you can specify the compatibility settings with which you want to run the program. For example, to run the application in compatibility mode with Windows 7 and 640x480 resolution, set:

set __COMPAT_LAYER = Win7RTM 640x480

Of the options of the variable __COMPAT_LAYER of interest to us, we select the following parameters:

  • RunAsInvoker- launching the application with the privileges of the parent process without asking for UAC.
  • RunAsHighest- launching the application with the maximum rights available to the user (the UAC prompt appears if the user has administrator rights).
  • RunAsAdmin- launching the application with administrator rights (the AUC request always appears).

Those. the RunAsInvoker parameter does not grant administrator rights, but only blocks the appearance of the UAC window.

To install some software requires administrator rights. In addition, the administrator himself can place restrictions on the installation of various software. In the case when it is required to perform the installation, but there is no permission for it, we suggest using several simple methods described below.

There are many different software on the Internet that allows you to bypass protection and install the program under the guise regular user... We do not recommend using them especially on work computers, as this can have serious consequences. We will present you with safe installation methods. Let's take a closer look at them.

Method 1: Granting rights to the program folder

Most often, software administrator rights are required when actions will be performed with files in their folder, for example, on the system partition hard disk... The owner can grant full rights to other users to certain folders, which will allow further installation under the regular username. This is done as follows:


Now, during the installation of the program, you will need to specify the folder to which you have given full access, and the whole process should be successful.

Method 2: Run the program with a regular user account

In cases where it is not possible to ask the administrator for access rights, we recommend using the built-in Windows solution... Using the utility via command line all actions are carried out. All you need to do is follow the instructions:


Method 3: Using the portable version of the program

Some software has portable version that does not require installation. You just need to download it from the official website of the developer and run it. This can be done very simply:


You can transfer the software file to any removable storage device and run it on different computers without administrator rights.

Today we looked at several simple ways how to install and use various programs without administrator rights. All of them are not complicated, but they require certain actions to be performed. We recommend that you simply log in to the system with account administrator if available. Read more about this in our article at the link below.

In the operating room Windows system in certain situations, the tools must be used with elevated privileges. This is necessary because of actions that lead to changes at the system level and ordinary users (not admins) do not need it. In this article I will talk about running any application on a computer as an administrator.

When you start programs with elevated rights, a window appears in which you need to confirm the launch -. Some users disable this feature altogether. Thus, the security of the computer suffers. After all, if the UAC warning window does not appear, any malicious infection will be able to start from your computer as an administrator. "Bad" code and write it all.

To make it easier for users to run programs as an administrator, I have prepared a couple of methods.

Run as administrator using the context menu

The context menu is invoked with the right mouse button. Click on any program with the mouse and from the context menu click on the option “ Run as administrator". This opens the command line and other programs where elevated privileges are required.

Using the shortcut Ctrl + Shift + Enter when searching

When there is no tool on the desktop or in the Start menu, we turn to search. Any Windows version equipped with it, and in the tenth it is most convenient. Write some command, for example, cmd - command line. Having selected the result, we simultaneously hold down the combination Ctrl + Shift + Enter... Easy way isn't it?

Additional shortcut properties

Let's say you are interested in a question,. The icon is already on the desktop as a shortcut, but you don't want to run the context menu all the time. This problem can be solved.

We go into the properties of the shortcut (right mouse button and Properties) and go to the section " Additionally».

Will open Extra options... There, check the "Run as administrator" option. Now, when the program starts normally, it will always open with elevated rights.

Additionally! In the properties on the "Compatibility" tab there is an option "Run this program as administrator". Also a useful thing.

Programs to run as administrator

There are the following programs: RunAs, AdmiLink, ExecAS.

RunAs tool

It is part of Windows so you can use it. To run it, just open the command line and enter the following command:

Most likely you will be asked to enter a password. Be sure to enter.


Let's create a desktop shortcut. Right-click on an empty area and select "Shortcut". We prescribe the same command as the location:

runas / user: PCName \ UserName msconfig.exe

Give a name to the shortcut and save.

After launching the shortcut, a command line will open, where you must enter the password for the account. When you enter the correct information, msconfig or the utility of your choice will start immediately.

In this situation, you or people with access to the PC will enter the password each time. This point is solved by adding the / savecred parameter to the command, then the command will be like this:

runas / savecred / user: PCName \ UserName msconfig.exe

If you are thinking about security, then it is better not to use such shortcuts with this option. It is better to enter the password every time and do not worry that some impudent will use Windows tools without a password to please yourself and to your detriment.

Using the ExecAS tool

Running as administrator is possible with the ExecAS program. After starting, a window appears with a proposal to enter account information (login and password), as well as the program name and path. After entering the data, click " Write down».


Our guinea pig has appeared in the ExecAS window. Close the program and reopen it. The program specified by us in ExecAS will immediately open. To add additional annex you need to register ExecAS.exe / S on the command line. (In this case, you need to be in the directory with the utility, for example, C: \ ExecAS).


Having launched ExecAS, we add another program. Close the tool and run it again. The same window appears. But this is not convenient for us, so let's move on to creating shortcuts:

We make two shortcuts with the following commands:

  • C: \ ExecAS \ ExecAS.exe 1
  • C: \ ExecAS \ ExecAS.exe 2

The numbers 1 and 2 correspond to the program number in ExecAS.

By running the shortcuts, we see that they were opened as administrator.

Using the AdmiLink utility

The utility specified in the title is a console utility, and after installation it will be located in the Windows directory.

We launch the tool and see a quite convenient window with a Russian interface, so it will be easy to figure it out.

  • In the first field, enter the path to the file that we want to run;
  • Command line parameters in the second field are optional;
  • The third line will be filled in on its own, if it is not, enter C: \ windows \ system32
  • Window display mode. There are 2 parameters in the 4th line:
    • SHOW - standard software launch with a visible window;
    • HIDE - software work in the background;

Configuring the parameters on the tab Account:

  • As the domain name, write the name of your PC, or NetBios and test.lan;
  • Username - can be selected by clicking on the button with three dots;
  • Account password and confirm.
  • After entering all the data, press the button " Test».

The utility will check the performance of the information we specified. We press any key in CMD.

After a successful test, press the button " Generate AdmiRun Launch Key". If you don't, then nothing will work.

  • Go to the "Link" tab and do the following:
  • Shortcut name- we call it by any name;
  • Catalog- indicate where the label will be located;
  • Picture- choose an image for the shortcut;
  • We press the button "Generate command line".
  • Now press the big button "Create Shortcut Now!".

The icon will immediately appear on the desktop or directory that you specified.

Trying to run a shortcut. If everything is successful and the program was launched on behalf of the administrator, then congratulations. Otherwise, the actions at some step were performed incorrectly.

If you go to the properties of the shortcut and change the program in the "Object" field to another, then it simply will not start. This is a small defense against malware.

Task Scheduler

Run the program as administrator, it is enough to use the tool “ Task Scheduler". There is one nuance here - if you are not an administrator, then you will not be able to use it.

Enter in the search just two words: "Task Scheduler" and open the result. In the window on the right, select the item " Create task».

Call it an appropriate name, let's say you run the command line, then you can call CMD. Also check the box "Run with the highest rights."

Shortcut creation stage

On the desktop, make a shortcut and specify the following command:

schtasks / run / tn task_name_in_planner

task_name in the scheduler is the name you gave at the very beginning of the task creation process.

Hooray, we made a shortcut, but that's not all. Go to its properties.

In the Shortcut tab, change the icon. Of course, you don't have to do this.

Addition to the method with the task scheduler

conclusions

We've covered a bunch of ways to run programs as an administrator. There are options where you need to enter a password - this is one of the secure solutions, because every time we enter a password, we can not be particularly afraid of losing some data. Virus programs will also fail to run Windows tools in this manner.


2021
maccase.ru - Android. Brands. Iron. news