Questions tagged [process-elevation]

20 questions
174
votes
7 answers

Elevating process privilege programmatically?

I'm trying to install a service using InstallUtil.exe but invoked through Process.Start. Here's the code: ProcessStartInfo startInfo = new ProcessStartInfo (m_strInstallUtil, strExePath); System.Diagnostics.Process.Start (startInfo); where…
Scott Marlowe
  • 7,915
  • 10
  • 45
  • 51
10
votes
3 answers

How to set the process priority in C++

I am working on a program to sort data, and I need to to set the process to priority 31, which I believe is the highest process priority in Windows. I have done some research, but can't figure out how to do it in C++.
john
  • 111
  • 1
  • 1
  • 3
9
votes
4 answers

How to Start a Process Unelevated

My app runs as requestedExecutionLevel set to highestAvailable. How do I run a process unelevated? I tried the following but it didn't work: Process.Start(new ProcessStartInfo {FileName = "foo.exe", Verb = "open"}) I have tried the following trust…
Elmo
  • 6,409
  • 16
  • 72
  • 140
7
votes
2 answers

Start process as limited user from elevated script

I have an elevated console running some bat files. Having this console running in elevated mode is mandatory for it to be able to perform some tasks like managing network shares, etc without asking for permissions. But sometimes the scripts also…
Áxel Costas Pena
  • 5,886
  • 6
  • 28
  • 59
6
votes
2 answers

Set app to require elevation?

I'm working on the bootstrap application of a new installer for some of our products. So far, I've been relying on two things that I read about somewhere: Applications whose name contains "setup" or "install" will run elevated by…
RobH
  • 1,607
  • 2
  • 24
  • 44
3
votes
2 answers

Impersonating in .NET using Process.Start and UAC

I am trying to run programs from another .NET program that requires elevation using the impersonation option of the Process.Start (System.Diagnostics) method. The user for impersonation is a local administrator. The O/S is 2008 and UAC is turned…
Dani
  • 461
  • 2
  • 5
  • 7
2
votes
1 answer

When a process is elevated how can I get the windows authentication ID of the non elevated session

I need to get the AuthenticationID as returned by GetTokenInformation with the TokenStatistics class for the user that logged in on the station whether I'm elevated or not. Lemme give you some more info. Suppose I do : var Result =…
Sébastien Nussbaumer
  • 6,202
  • 5
  • 40
  • 58
2
votes
2 answers

Windows 2008: application crashes when __COMPAT_LAYER=ElevateCreateProcess

There is application that can be started properly by Windows 2008, lets call it App1. When the same application is started by another application (Launcher), App1 crashes in secur32.dll. Research indicated environment in those 2 cases was…
vt.
  • 1,325
  • 12
  • 27
2
votes
0 answers

Running an elevated process as a standard user

Let us assume that there are two accounts in my system - one administrator and the other one a standard user. I have noticed that when a standard user attempts to start a program, say command prompt, with elevated privileges, the UAC asks for the…
Bharath Suresh
  • 483
  • 2
  • 18
2
votes
3 answers

Newly compiled application requires UAC/elevation?

I have a system, I set it up as a normal with UAC, and in my delphi environment I compile my project named ka.exe, I create a installshield project for it. setup and everything completes ok! but whenever I start my program, it requires elevation and…
Plastkort
  • 957
  • 1
  • 26
  • 40
2
votes
2 answers

How to detect if a specific process is elevated using dotnet or powershell

How can I detect if a specific process is elevated or not. This process is different than the process where my code is running. I'd like to be able to do this from with PowerShell or C#.
klumsy
  • 4,081
  • 5
  • 32
  • 42
1
vote
1 answer

PowerShell - Start another instance of PowerShell.exe without elevation and using -NoProfile

I'm trying to run a new instance of powershell.exe (from PowerShell/ISE/pwsh/VSCode) with lowered elevation using its -NoProfile switch but haven't figured out a way to pass the -NoProfile switch in a way that results in a newly non-elevated…
1
vote
1 answer

Silent update for application service installed using MSI

Is there any good example of how application service installed via MSI and independent of any user-context handling the problem of silent auto-update/on-demand update. How will the service have admin privileges to do silent update since without…
1
vote
2 answers

elevation demand not working for method in winforms app

I have a winforms app that installs other apps in a loop. This works properly on an administrator account in Windows 7, but I have serious issues in a standard account - the app requires elevation in order to write to "Program Files(x86)"…
Amc_rtty
  • 3,662
  • 11
  • 48
  • 73
1
vote
0 answers

How to start an unelevated process from from an elevated process

My application might be running with elevated privileges (it's an app launcher) and I need to launch other application with standard privileges (so that it's not running as admin). My application is not a setup. How can I do that? I need to both…
Andrea Nagar
  • 1,233
  • 2
  • 13
  • 23
1
2