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
14
votes
3 answers
How to connect to PostgreSQL through CLI?
I am trying to access postgresql through the command line. However, whenever it is time for me to enter my password, I get the following error: Fatal: password authentication failed for user RMehta. I am pretty sure the reason that password…

Ravi Mehta
- 485
- 1
- 6
- 15
14
votes
5 answers
Using runas command to remotely logging into SQL Server
I am stuck at this point using the runas command. I am trying to log into a remote SQL Server instance using Windows Authentication on that server. I am using this command -
runas /netonly /user:Domain\Username
/server=someIP "C:\Program…

Kumar Vaibhav
- 2,632
- 8
- 32
- 54
11
votes
4 answers
Starting .ps1 Script from PowerShell with Parameters and Credentials and getting output using variable
Hello Stack Community :)
I have a simple goal. I'd like to start some PowerShell Script from an another Powershell Script, but there are 3 conditions:
I have to pass credentials (the execution connects to a database that has specific user)
It has…

Dmytro
- 372
- 2
- 12
11
votes
2 answers
Verb RunAs in a Start-Process Powershell command causes an error
If I run the following command in a Poweshell script file ($cmd refers to some executable):
Start-Process -FilePath $cmd -Verb RunAs Powershell
Then it executes OK
But if I slightly modify it:
Start-Process -NoNewWindow -FilePath $cmd -Verb RunAs…

Vagif Abilov
- 9,835
- 8
- 55
- 100
10
votes
5 answers
Runas in another Windows terminal session
For simplicity, let's say the user Administrator is logged in in terminal session 2. Another user Boda is logged in terminal session 3.
Is it possible to runas a program in session 3 from session 2?
For simplicity, let's say I want to start calc.exe…

bodacydo
- 75,521
- 93
- 229
- 319
10
votes
2 answers
Eclipse: "Run as" does not display the list elements (such as "Run as android application")
This morning I've updated my Ubuntu version and now I can't run my application from eclipse.
The problem is that the list that appears when I click on "Run As" is empty and I can't run anything.
How I can solve this problem?
The only error that I…

Meroelyth
- 5,310
- 9
- 42
- 52
9
votes
0 answers
Runas verb not elevating on specific Windows 10 machines
I have a really odd issue, where some code that we have been running for years has stopped working on certain machines. There is no obvious pattern to the machines (in terms of Win10 build number or patch level).
The code is designed to run an…

Ben
- 4,281
- 8
- 62
- 103
9
votes
2 answers
Unable to launch Visual Studio 2015 as a different user
In order to limit my own destructive powers, I have two domain accounts, one for normal work and one for TFS admin stuff. For years I have been using the Run as different user feature for opening another Visual Studio window as my admin account…

Tore Østergaard
- 4,362
- 3
- 27
- 43
9
votes
2 answers
NAnt: executing NCover as administrator account - runas returns directly without waiting
My NAnt build runs as a non-admin as part of CruiseControl. But we have an NCover task which needs to run as an Administrator. For this we are thinking about using RunAs with an admin account.
The problem is that RunAs returns directly and doesn't…

Dries Van Hansewijck
- 1,314
- 7
- 15
7
votes
4 answers
Run new process as different user in vb.net
I'm currently using a homegrown method to run a process as a different user in Vista, and I can't escape the feeling that's it hack-ish and less than ideal (in addition to the fact that it craps out UAC, crashing my app with a security exception,…

SqlRyan
- 33,116
- 33
- 114
- 199
7
votes
3 answers
Python subprocess.Popen as different user on Windows
What is the best manner of launching a subprocess as a different user in Python on Windows? Preferably XP and up, but if it works only on Vista and 7, I can live with that too.

Eric Pruitt
- 1,825
- 3
- 21
- 34
7
votes
1 answer
Escalate Privilege at Runtime (Windows API C/C++)
My application does not always require "admin" privileges and most of the time would run as the current user. Is there any way, I can escalate privs by throwing up a UAC at runtime after my program is already running? This will only happen as and…

MathOldTimer
- 1,311
- 3
- 13
- 22
7
votes
1 answer
run cmd.exe as administrator in a script
I have a script that I need to run as Administrator just as I would right click on cmd.exe and click Run As Administrator.
Currently this is what I have:
Call WSHShell.Run("cmd.exe /K netdom renamecomputer ... end code")

Robert
- 809
- 3
- 10
- 19
6
votes
2 answers
Can I specify a user account for a GitHub action step on a Windows runner?
I'm working with a GitHub action step on a Windows runner. One of the requirements of the executable I'm trying to run is that it can't be run as an administrator.
It's there any way I can create and become a different user to the default…

Alexander Trauzzi
- 7,277
- 13
- 68
- 112
6
votes
2 answers
Using python to open cmd and automatically enter a password
I've managed to get the cmd being opened by python. However, using runas administrator comes with a password check before cmd.exe is executed.
I'm using this to open cmd...
import subprocess
subprocess.call(["runas", "/user:Administrator",…

ExoticScarf
- 75
- 1
- 2
- 8