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
4
votes
1 answer

How can a program (.NET) tell if it is being run as a different user?

Is there a way to detect from my .NET program whether it is being run as the desktop user normally or being run as a different user using the "run as a different user" menu option/runas command?
fangster
  • 361
  • 2
  • 9
4
votes
2 answers

Set ProcessStartInfo.EnvironmentVariables when Verb="runas"

I am developing a C# application. I need to create and pass variables to a new process and I am doing it using ProcessStartInfo.EnvironmentVariables. The new process must run elevated so I am using Verb = "runas" var startInfo = new…
user844541
  • 2,868
  • 5
  • 32
  • 60
4
votes
2 answers

Run batch file from VB.NET as administrator

In my VB-NET application I need to run a batch file as administrator. So far I use this code but can't remember how to use runas: process.start("filelocation.bat") Any help is apreciated.
Chris Wilson
  • 59
  • 1
  • 1
  • 7
3
votes
1 answer

"Runas" in Ant script

I have an application which needs to run with different user name. I am trying to call "runas.exe" to call the batch file which calls my application. When I tried this in command prompt it worked fine. One drawback is I have to provide password I…
KK99
  • 1,971
  • 7
  • 31
  • 64
3
votes
2 answers

Create PSCredential from AzureAD User

I don't know why I can't figure this out, this can't be as hard as I'm making it. I'm trying to create a powershell script that will elevate itself using explicit credentials from AzureAD. I create a PSCredential object with: $ss =…
JustinM
  • 125
  • 1
  • 8
3
votes
1 answer

Connect to SQL Server Windows Authentication using DBeaver

Currently, I'm using SQL Server Management Studio (SSMS) to connect to remote SQL Server. And we are using command-line to connect to that server. $ path\to\runas.exe /netonly /user:DOMAIN\USERNAME "path\to\Ssms.exe -S ip.xxx.yyy.zzz" How can I…
Mrye
  • 699
  • 3
  • 10
  • 31
3
votes
3 answers

Eclipse keep deploying to device in debug mode

After deploying to my device once for debugging, every time I try and "Run As" in regular mode it still attached the debugger. I have deleted the application from the device and it still does this. This causes and issue when I just want to run the…
FARNK
  • 31
  • 2
3
votes
1 answer

Start-Process powershell cannot find specified

Edit5: Adam's code works unless there are spaces in the path. That solution is at Powershell Opening File Path with Spaces Edit4: Simplified further with a test for the path. Same Error. If ($args[0] -eq "admin") { $TheScriptPath =…
Logan Jones
  • 324
  • 1
  • 3
  • 10
3
votes
1 answer

Using @RunAs in my EJB Schedulers

I have many EJBs with my business methods. These methods use @RolesAllowed annotation to check if user can execute this method. So I have an EJB Scheduler that calls these EJB methods. EJB schedulers runs with anonymous user, so authorization…
Otávio Garcia
  • 1,372
  • 1
  • 15
  • 27
3
votes
4 answers

Run explorer.exe as Administrator user within Windows 7

I have the Windows 7 operating system, and I have administrator user credentials stored (known in advance). I know we can run a program or .exe using "Runas" verb and launch a process, but my question is specific to explorer.exe. I am trying to run …
user393014
  • 445
  • 1
  • 8
  • 15
3
votes
1 answer

Process with Verb = "runas" does not start with the credentials defined in Arguments

This var psi = new ProcessStartInfo("cmd") { Verb = "runas", UseShellExecute = true, Arguments = "/user:domain\\username" }; var ps = Process.Start(psi); does not start…
Nash
  • 69
  • 9
3
votes
0 answers

struts2 set in web.xml

So I am trying to migrate from struts1 to struts2 and the project have in servlet struts1 web.xml: action com.servlet.ActionServlet ...
Andy
  • 103
  • 1
  • 5
3
votes
0 answers

How can I run Visual Studio as a non-administrator?

I seem to be unable to start Visual Studio 2015 as a non-Administrator in Windows 8.1 Pro. I have tried: Deleting all VS references from: HKEY_CURRENT_USER\Software\Microsoft\Windows…
3
votes
0 answers

RunAs and C# process - impersonate user credentials not working

I want to create a simple application to launch another application under different credentials. Both application are on my laptop which is not on the domain. I need to run SSMS using a domain user credentials. When I use the following runas…
Baral
  • 3,103
  • 2
  • 19
  • 28
3
votes
1 answer

How to run executable from PHP website as a specific Windows user?

By default PHP runs under IUSR account. When executed directly: $lastline = exec('D:\\MyProgram.exe', $output, $return_var); It runs, but the program is unable to do it's tasks due to insufficient privileges. My question is: How do I run an…
Slava
  • 2,887
  • 3
  • 30
  • 39