Questions tagged [runas]

runas is a Windows command which allows a user to run a specific program under the credentials of another user.

322 questions
6
votes
1 answer

Automatically respond to runas from batch file

I'm trying to get a batch file to automatically enter the password into the "runas" program, but I can't get it to work. Here's my batch file so far: echo password | runas /user:testuser c:/path/to/my/program.exe However, I get an error saying…
user1578653
  • 4,888
  • 16
  • 46
  • 74
5
votes
1 answer

Run ASP.NET Core App in Docker Running as Custom User

I have an ASP.NET Core app connecting to a database using Integrated Security=True in the connection string, so that the credentials of the user running the app are used to connect to the database and so that I don't have to add a username and…
5
votes
2 answers

Detect if .net application is started with runas /netonly

Is it possible to detect if an application is opened with the runas command? And how can I detect which user is used? runas /netonly /user:DOM\usr "C:\App.exe"
Tim
  • 140
  • 1
  • 1
  • 5
5
votes
1 answer

Set "Run as Administrator" for shortcut automaticlly

In Windows 7, you can set a property of a shortcut to "Run as Administrator", so that the application is invoked with Administrator privileges or the user is asked for an admin account. I know I can request/force Administrator privileges with a…
TalkingCode
  • 13,407
  • 27
  • 102
  • 147
5
votes
2 answers

How does one execute the windows runas command from inside cygwin

If I try to use the Windows runas command from inside Cygwin the Enter password line prints to standard out but it doesn't wait for me to type my password into System.in Is there a way around this?
James Robinson
  • 1,222
  • 1
  • 15
  • 43
5
votes
4 answers

Win7 runas command: How to capture output of command that is run?

I'm trying (under Windows 7) to use the runas command to stop then restart a service. (Win7 requires admin privs to do this; thus the use of runas.) Stopping the service works fine, but starting it does not. Here's the command I'm using for stopping…
Bill Cohagan
4
votes
2 answers

Runas Password in Batchfile

i want to run a batchfile with a runas command in it. Is it possible to link the password in Batch file? For example: runas /profile /user\domain PASSWORD thanks in advance for your answers
lucas220700
  • 43
  • 1
  • 1
  • 4
4
votes
5 answers

How to run VSCode from the command prompt

I for security reasons cannot run VSCode plainly. I have opened it in the past, but now due to specific reasons, I may only run VSCode from the command prompt. I've tried start "path/to/file" code and start code "path/to/file" but none work I'm on…
255.tar.xz
  • 700
  • 7
  • 23
4
votes
4 answers

Runas command Access denied

I want to run a program from startup by a batch file in startup folder, the file says this: runas.exe /savecred /"user:pedro burgos" "%cd%\test.bat" But, the problem is that when I run this and enter my password, it says Error 5: Access denied Can…
user7637980
4
votes
1 answer

how to find out who is running the runas application?

background: In my org there is an application that we use for some critical functions, but it only works best when run as a particular user. The reason for this is that the application stores lots of its configuration as the local user session, and…
Kareem
  • 534
  • 1
  • 6
  • 17
4
votes
3 answers

How to prompt to run EXE as different user in powershell

How would I go about running an EXE as a different user? How could I prompt for credentials or atleast ask for the password for a local admin to launch an exe through powershell. I'm having a hard time getting the runas command to work. This was…
user2746059
  • 43
  • 1
  • 1
  • 4
4
votes
1 answer

Run child process non-elevated from an elevated/As Admin process

My application has a built-in self update system via another app called "updater.exe" which is in the same folder with the main application to update. It downloads the newest version, terminates the old one (if it's running) and then overwrites…
Roni Tovi
  • 828
  • 10
  • 21
4
votes
1 answer

Powershell start notepad.exe and a command windows starts and disappears

I have a script to start another ps1 script as aspecific user that does a simple dir on a directory and it works, when it runs a separate cmd window appears with the directory contents. $encpwd = Get-Content C:\path\to\creds.txt $passwd =…
user1548815
  • 73
  • 2
  • 2
  • 8
4
votes
2 answers

runas /savecred... don't accept cmdkey /add (credentials)

I have a problem with runas /savecred ... and cmdkey /add.... I have a batch file contains this line: runas /profile /savecred /user:MyDomain\MyUserName "MyProgram.exe" I'm logging to my computer as Administrator and I want to execute…
Phiber
  • 1,041
  • 5
  • 17
  • 40
4
votes
1 answer

RunAs Command Failing With Error 299

I have tried using the "runas" command from Windows to run a program with lowered credentials than those of the currently active account (in order to "sandbox" that program to be only able to access certain directories and files). It works fine, for…
user2791287
  • 43
  • 1
  • 1
  • 4
1 2
3
21 22