Questions tagged [process-elevation]

16 questions
155
votes
5 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,535
  • 10
  • 42
  • 50
9
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
  • 101
  • 1
  • 1
  • 2
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,545
  • 2
  • 23
  • 40
6
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
  • 4,754
  • 5
  • 26
  • 53
5
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
  • 5,743
  • 15
  • 64
  • 132
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
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,192
  • 10
  • 26
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
  • 927
  • 1
  • 23
  • 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
  • 3,521
  • 4
  • 27
  • 40
1
vote
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
  • 5,534
  • 4
  • 36
  • 54
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,221
  • 9
  • 40
  • 69
1
vote
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
  • 427
  • 2
  • 16
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,173
  • 2
  • 11
  • 22
0
votes
1 answer

Running a loop of processes that require admin rights

I have an application that does a loop which starts some processes programmatically one by one. My app itself runs under a standard user, but I need to run only those processes as admin so I can install them. To achieve this, I use the 4th response…
Amc_rtty
  • 3,221
  • 9
  • 40
  • 69
0
votes
0 answers

How to elevate the current C# program only when needed?

How would I go about elevating my running C# program only when necessary? I come from Java and I see programs like IntelliJ only calling on their "elevator.exe" when a task requires administrator privileges. So, I am wondering how I would go about…
Ark1409
  • 25
  • 6
1
2