uac

CreateProcess to run as administrator

一曲冷凌霜 提交于 2019-12-01 11:30:21
In my Win32 application I have the ability to run child processes with redirected input and output to anonymous pipes that I create and manage - this all works with the CreateProcess() function. However on Win7 (and presumably Vista) if that process is required to be run as administrator then this fails. So what I am looking for is a way to do the equivalent of the "run as administrator" command in explorer that will bring up the standard UAC prompt and then create the process with the elevated permissions. I have seen articles that talk about using the "runas" option to ShellExecute to do

Executing a process normally from an elevated one

蹲街弑〆低调 提交于 2019-12-01 09:09:25
问题 Is there some way to launch a process in non-elevated way from an elevated one. My setup is launched elevated and when it finalizes, it will just launch the main application. Because the setup is elevated, the main process will be elevated as well which is not desirable. What is the best solution to this? 回答1: That's a problem, Vista/Win7 don't appear to have an API to obtain the unprivileged user token you need to call CreateProcessAsUser(). The only solutions I've found involve using the

Help with understanding why UAC dialog pops up on Win7 for our application

ぐ巨炮叔叔 提交于 2019-12-01 04:42:23
We have a C++ unmanaged application that appears to cause a UAC prompt. It seems to happen on Win7 and NOT on Vista Unfortunately the UAC dlg is system modal so I can't attach a debugger to check in the code where it is, and running under msdev (we're using 2008) runs in elevated mode. We put a message box at the start of our program/winmain but it doesn't even get that far, so apparently this is in the startup code. What can cause a UAC notification so early and what other things can I do to track down the cause? EDIT Apparently the manifest is an important issue here, but it seems not to be

Is there a shared folder in Windows to which non-elevated users have write access?

爱⌒轻易说出口 提交于 2019-12-01 03:59:47
I know that commonappdata (All Users) can hold system-wide application settings, but under Vista/7 non-elevated users can't write to that directory. Is there a folder which is shared among users and any non-admin user can write to it? Here is why I need this: My app is installed in PF directory by an Inno Setup installer with elevated rights. Then when the actual non-admin user runs the program, it copies its settings to the user's AppData directory using another non-elevated Inno Setup installer. Upon deinstalling the program (initiated by the system-wide installer with admin rights) I want

Help with understanding why UAC dialog pops up on Win7 for our application

跟風遠走 提交于 2019-12-01 02:12:24
问题 We have a C++ unmanaged application that appears to cause a UAC prompt. It seems to happen on Win7 and NOT on Vista Unfortunately the UAC dlg is system modal so I can't attach a debugger to check in the code where it is, and running under msdev (we're using 2008) runs in elevated mode. We put a message box at the start of our program/winmain but it doesn't even get that far, so apparently this is in the startup code. What can cause a UAC notification so early and what other things can I do to

Run with administrative permission issue

天大地大妈咪最大 提交于 2019-12-01 01:50:17
I am using Windows Vista and I find something strange, I programatically invoke IE to open IE to access some local html page, the current user belongs to administrator group; I programatically invoke IE with RunAs parameter, and let IE to access access some local html page, the current user belongs to administrator group; I find (1) and (2) sometimes have different results (page content), especially when there is ActiveX or Silverlight plug-in in the local page. My confusion is, if the current user belongs to Administrator Group, it should not matter whether we use RunAs parameter. Why still

Using QT Creator how can I set the execution level as requireAdministrator

依然范特西╮ 提交于 2019-12-01 01:01:40
Basically I need to be able to edit files that require administrator privileges to edit. I know that in Visual Studio a manifest file is used for this - but I understand QT does not have these. You can use a manifest with Qt applications, but you'll have to do it semi-manually. This blog post Embedding Application Manifest and Version Information using QtCreator shows one way of doing it (adapt the manifest to suit your needs). GimbleJune 29, 2012 at 8:59 AM Just to add another less-intrusive way with VS2010 and Qt4.8+, from http://www.qtcentre.org/threads/29107-win32-how-to-modify-the

What are the differences between “Run as administrator” and a manifest with requireAdministrator?

守給你的承諾、 提交于 2019-12-01 00:01:54
I've written a program with a manifest that includes requireAdministrator. On Windows 7 systems with UAC enabled, Windows pops up a dialog asking for permissions, as it should. Works great. If a user starts my program by right-clicking it and choosing "Run as administrator", then Windows 7 also pops up a dialog asking for permissions. However, there are some slight differences in how my program operates in some of the more esoteric parts of my program. So what are the differences between "Run as administrator" and a manifest with requireAdministrator? Any links to documentation that describe

Developing Apps with Administrator Rights in Delphi

混江龙づ霸主 提交于 2019-11-30 20:35:19
I'm using D2010 under Windows 7 to write an app that seems to require admin rights (I think because it uses COM to communicate with a third party .exe, which also requires admin rights). I've added the manifest resource as required, but when I try to debug the app from the IDE, it reports "Unable to create process. The requested operation requires elevation" ...and it won't run. If I run Delphi as administrator, then my app runs correctly, but this feels like a dangerous brute force approach, especially as most of the apps I develop don't need admin privileges. Is there any way of getting

Restart program unelevated

北城以北 提交于 2019-11-30 20:23:21
For some reason, my C# program needs to restart with elevated privileges. I use the following code to achieve it: private static void RestartForPermissionsFix() { ProcessStartInfo processInfo = new ProcessStartInfo(); processInfo.Verb = "runas"; processInfo.FileName = Assembly.GetExecutingAssembly().Location; Process.Start(processInfo); } This works great. After I "fix my privileges", I want to restart the program unelevated . I tried the same as above without the "runas", but it does not work. I assume the process being started from an elevated process automatically gets elevated. Any idea?