runas is a Windows command which allows a user to run a specific program under the credentials of another user.
Questions tagged [runas]
322 questions
3
votes
1 answer
Granting c++ program administrative rights through UAC at startup
So I've done some research, but I'm interested in understanding how one would make his program ask for administrative privileges from the UAC before its execution. Would this require one to use "runas" inside the ShellExecute()? I realize that this…

AEGIS
- 162
- 1
- 3
- 17
3
votes
1 answer
Using "runas" command from PHP
This question is related to: Using "runas" command for a program that writes a file (Windows Server 2008)
I tried to run the runas command from PHP to run that console program:
But it…

ArthurN
- 179
- 5
- 15
3
votes
2 answers
RunAs Prompt for credentials
I'm trying to write a batch script that will do a RunAs for any given windows service (using explorer.exe to test) for any given user that can be input at time of running. What I currently have is this.
set /p Var1="Domain = "
set /p Var2="Username…

Gary Barnett
- 33
- 1
- 3
3
votes
2 answers
Run as Current logged User
I have two executables. My first is running under administrative privileges. I want to start another process with current logged in user. I don't know password of the current logged in user. How do I do that?

Rupali
- 105
- 2
- 13
3
votes
2 answers
runas does not allow complex arguments?
I have an app that I'm trying to run elevated on windows 7 and windows xp thin clients but I cant seem to get the runas.exe cmd line correct. I know I need the backslash escape character in there so runas interprets the spaces correctly. This…

Ryan
- 83
- 1
- 2
- 9
3
votes
1 answer
Windows CMD Batch File Run A Command as Administrator
I have a batch file where I want to run some commands, but not all of them as administrator. I do not want to run the command prompt as administrator or run the entire batch job as administrator. An example of a command that I want to run as…

cytinus
- 5,467
- 8
- 36
- 47
2
votes
2 answers
Is there any way to pass (Powershell) secure-string credentials to runas command?
I would like to invoke Clearprojexp.exe as runas different user.
I was trying to use as follows in my powershell prompt
runas /noprofile /user:Domain\UserName Clearprojexp -credential (Powershellfile.ps1 -get "E:\EncryptedPwd.txt")
But it asks to…

Samselvaprabu
- 16,830
- 32
- 144
- 230
2
votes
4 answers
Using Run As to run multiple instance of IE 8 doesn't seem to work
In the past, I've used the runas commandline to launch another instance if IE on a secondary account for testing, since our in-house web-app application uses windows authentication to identify a user. With the new multi-process model if IE8, this…

ProKiner
- 697
- 7
- 12
2
votes
3 answers
How do I start an out of process COM server as another (more privileged) user
I would like to create a COM object that runs in an out of process COM server as another user. How do I do that?
I have control over the COM server source code and my COM client is the only one that will be creating these COM objects.

Hannes de Jager
- 2,903
- 6
- 37
- 57
2
votes
1 answer
Setting folder permissions using NSIS
I am attempting to set an open folder permission (i.e. Everyone has Full Access) using NSIS with RunAsW plugin that calls cscript.exe in an elevated user permissions.
As follows:
Function ReplaceEXE
ClearErrors
SetOutPath '$TEMP'
File…

Drew Turketo
- 33
- 1
- 4
2
votes
1 answer
Runas /NETONLY from C#
I am trying to write a C# program that does the same thing as runas /netonly.
Doing the same thing as runas is easy, and I found many examples. However, doing a /netonly, exactly like runas, does not seem to be easy.
I found from various answers the…

laperouse
- 151
- 1
- 4
2
votes
4 answers
how to forbid process termination by regular user?
I cannot implement it as a windows service because my process has to interact with desktop and it's prohibited in Windows 7.
What is the simplest way to accomplish this? Starting under another (privileged) user? How to do this?
My users are not…

Andriy Tylychko
- 15,967
- 6
- 64
- 112
2
votes
1 answer
runas or psexec inside Windows container
I have a windows image based on mcr.microsoft.com/windows:1809.
In my Dockerfile, I created a new user via
net user /add myuser mypassword
Now I would like to enter the container, e.g. via docker run -it and execute commands via the myuser (instead…

langlauf.io
- 3,009
- 2
- 28
- 45
2
votes
1 answer
Runas savecred resets after each login
I have a program set to launch automatically via a runas savecred command and would like to make it so that it doesn't prompt me for the password for each login
On Windows 10, I have a command shortcut in startup to launch a program as a different…

Joe V
- 21
- 2
2
votes
1 answer
Strange file-permissions if apps run as administrator
My program must be run as administrator and creates some files. If I run it manually by right-click on the icon and selecting "run as administrator" -- everything okay -- all users have access to created files. But if program launched from the…

Newbee
- 1,032
- 1
- 11
- 27