runas command: Enables a domain user/normal user user to run the specified program as an administrator.

Source: Internet
Author: User
Tags administrator password

Note: This article is written by Colin, all rights Reserved! Reprint please specify the original address, thank you for your cooperation!

In some cases, for security reasons, most companies use domain controllers or user rights that only give employees computer users, which can greatly improve security and controllability, but this also poses some problems.

For example: some specific departments (such as finance, logistics) do not have administrator rights, but the work needs to use a specific plug-in or program, and the program or plug-in must also run as an administrator, in this case, if we elevate the user's rights to the Administrator, that will increase the security risk and may cause a lot of uncontrolled situation.
In this case, we can use the RunAs command to specify that a program be run, which is the Microsoft system, as long as the Windows computer can be used, including the domain environment. This solves the problem of software usage without sacrificing security.

Below is the usage and examples of runas:

RUNAS usage:
RUNAS [[/noprofile |/profile] [/env] [/savecred |/netonly]]/user:<username> program

RunAs Use example:
Runas/noprofile/user:mymachine\administrator cmd
Description: Use the administrator administrator on this computer to perform cmd,/noprofile to not load the user's configuration information.

Runas/profile/env/user:mydomain\admin "mmc%windir%\system32\dsa.msc"
Description: Use the admin on this computer to scan the MSC console. /profile loads the user profile for the specified file. /env indicates the use of the current environment.

Runas/env/user:[email protected] "notepad \" My File.txt\ ""
Description: Run with domain user and specify to open my File.txt document using Notepad.

Practical Application Examples:
@echo off
Runas/user:colin-pc\administrator/sa "C:\Program files\internet Explorer\iexplore.exe"
Description: Run IE browser as administrator.

In this way, after we save the command as a batch, whenever the batch is run on the user's computer (the first time an administrator password is entered), the user can then double-click the file to execute the program specified in the command as an administrator.

————————-

Is that it?
No!

If the user is a little bit of computer-based, he will know how to edit the batch, as long as he changed the specified program path to the program he wants to run as an administrator can be executed, it can not do anything?

So, to make sure that the batch is correct, we should do the encapsulation. (That is, files that are encapsulated as. exe, so that users cannot modify them.) )

The encapsulation operation is simple, and downloading a "bat to Exe Converter" program converts the. bat file to the executable file of the. exe.

Bat to Exe Converter is as follows:
Http://pan.baidu.com/s/1sjNM8Lf

Conversion method I will not introduce, there are a few options, I think as long as not mentally retarded should know how to use.
Programs that are encapsulated as. exe after:

This way, we just put the exe file in the D:\Program files directory, and then create a shortcut to the desktop, so that the next time users can be very convenient to use.

Of course, this step you can omit, directly put an. exe file to the desktop to the user can also line, but I hope that we still develop a good habit, the program is best placed in the D-Disk programs files directory. After the induction and re-installation of the system can be recovered.

Okay, here's the introduction. (or record it, record it yourself.) Record and share it with more people who may need help. )

By:colin

runas command: Enables a domain user/normal user user to run the specified program as an administrator.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.