Lsrunas software test successful: http://www.moernaut.com/default.aspx? Item = lsrunas
Other information posts:
If you use the Administrator permission to log on as a non-administrator user Program The RunAs command is required. You cannot simply use the pipeline to enter the password when running the script. You can use the following methods to avoid the trouble of entering the password each time.
1. Use the RunAs/savecred option that comes with the system. After you enter the password for the first time, the creden。 are saved.
Features: commands that can be run cannot be restricted, resulting in poor security.
2. Using Sanur, Sanur is a small program that can pass the password or content in the file to the RunAs program using the pipeline method.
RunAs | Sanur Password
RunAs | Sanur/I [drive:] [path] filename
Features: the password is stored in plaintext.
Related Pages:
Http://www.commandline.co.uk/sanur_unsupported/index.html
3. When lsrunas is used, the function is similar to Sanur, but it does not need to run RunAs and comes with complete parameters for execution.
Features: the password is stored in plaintext.
Related Pages:
Http://www.moernaut.com/default.aspx? Item = lsrunas
4. Use the enhanced version of lsrunase and lsrunas, and use the encrypted password. The built-in software lsencrypt is used to generate encrypted strings.
Usage:
Lsrunase/User: Administrator/password: 41 bnga ==/ domain:/command: notepad.exe/runpath: C :\
All parameters must be complete, including:
The user is the running account.
Password is the encrypted string
Domain is the machine name or domain name, or you can leave it blank to represent the Local Machine
Command is the name of the program to be run. If the parameter is included, quotation marks must be placed at the beginning and end of the command.
Runpath is the program startup path.
Features: It can perfectly replace RunAs and avoid directly saving the password in the script.
Related Pages:
Http://www.moernaut.com/default.aspx? Item = lsrunase
5. Using cpau, cpau is also a program that replaces RunAs. It is powerful and can use an encrypted password.
Usage:
Cpau-u administrator-P password-Ex notepad-file start_notepad.txt-ENC
Cpau-file start_notepad.txt-Dec
The preceding command can encrypt and save the command to be executed as a file and load the file during execution.
Features: it can protect scripts and commands executed by others from being viewed by others, but there are some problems when using the network path.
Related Pages:
Http://www.joeware.net/win/free/tools/cpau.htm
6. Using autoit, autoit is a tool for automated script execution. It can complete many automated tasks and compile the script into an EXE file to run it directly, this allows you to hide password information.
Features: powerful functions, but complex operations.
Related Pages:
Http://www.autoitscript.com/autoit3/
Other tools can perform similar operations.
Reference page:
Http://www.commandline.co.uk/sanur/