uac

How do I get around application scope settings being read-only?

廉价感情. 提交于 2019-11-27 14:03:55
What use are they if they cannot be altered from their default values anyway? Rhetorical question. First, what's the best way to circumvent the Settings system and write to the application scope settings file directly (security issues in the next paragraph)? XmlReader/XmlWriter? IIRC, if an application tries to write to its Program Files folder, Windows Vista and 7 does some magic to prevent that. I suppose I need to call UAC to elevate and I must put that fancy shield icon on my application's Options window's OK button and so on. Link to a quick how-to? Alternatively, you may tell me that

How do I avoid UAC when my EXE file name contains the word “update”?

女生的网名这么多〃 提交于 2019-11-27 13:33:49
问题 I noticed the following phenomenon: An executable built with Delphi 7 and part of the name including "Update" (e.g. "UpdateMyApp.exe") causes UAC to step in to display a warning like "do you want to allow the program to make changes to your computer". This happens with a simple hello world application. Showing the file in explorer shows the shield symbol overlayed to the application icon. As soon as you rename the exe the shield disappears and the application starts without warnings. As

Process.Start with different credentials with UAC on

大憨熊 提交于 2019-11-27 12:28:36
I am trying to start another process with Process.Start running under different credentials with the UAC turned on. I get the following error: System.ComponentModel.Win32Exception: Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) If I turn off UAC, it works fine. If I start the process without specifying

How can I detect if my process is running UAC-elevated or not?

隐身守侯 提交于 2019-11-27 11:53:51
My Vista application needs to know whether the user has launched it "as administrator" (elevated) or as a standard user (non-elevated). How can I detect that at run time? For those of us working in C#, in the Windows SDK there is a "UACDemo" application as a part of the "Cross Technology Samples". They find if the current user is an administrator using this method: private bool IsAdministrator { get { WindowsIdentity wi = WindowsIdentity.GetCurrent(); WindowsPrincipal wp = new WindowsPrincipal(wi); return wp.IsInRole(WindowsBuiltInRole.Administrator); } } (Note: I refactored the original code

How to UAC elevate a COM component with .NET

左心房为你撑大大i 提交于 2019-11-27 11:36:52
I've found an article on how to elevate a COM object written in C++ by calling CoCreateInstanceAsAdmin . But what I have not been able to find or do, is a way to implement a component of my .NET (c#) application as a COM object and then call into that object to execute the tasks which need UAC elevation. MSDN documents this as the admin COM object model . I am aware that it is possible and quite easy to launch the application (or another app) as an administrator, to execute the tasks in a separate process (see for instance the post from Daniel Moth , but what I am looking for is a way to do

Delphi 7 vista / windows 7 manifest

泄露秘密 提交于 2019-11-27 09:42:22
问题 Would anyone have an example of a manifest file for Delphi 7 which allows apps to run as administrator on Windows XP / Vista / 7? Running an application with this feature usually leads to a User Account Control (UAC) dialog asking for privileged permissions. 回答1: Here are the steps: 1. Remove XPMan : Remove any reference to XPMan component in your project. XPMan adds a default manifest to the executable that prevents Windows to see our customized manifest. You shouldn't be worried about XP

How to call LogonUser() to get a non-restricted full token inside a Windows Service with UAC enabled?

試著忘記壹切 提交于 2019-11-27 09:22:59
I am running a WindowsService on Windows Server 2012 and it needs to impersonate a domain admin user (who is also added to the local administrators group on the machine). UAC is enabled on the system and Calling LogonUser using the credentials with a LogonType of LOGON32_LOGON_INTERACTIVE, seems to return a restricted token instead of a full token. This is causing the administrative task i'm trying to do to fail. What is the right way to call LogonUser in this situation so that a full token is returned instead of an restricted token? PS: I came across a related question here How can I get

How to prevent Vista from requiring elevation on patch.exe?

只愿长相守 提交于 2019-11-27 09:14:15
[I'm sorry that this isn't directly a programming question. But I have recently switched to a new Vista machine where I am keeping UAC enabled (please don't tell me to disable it, it's not an option).] Every time I run gnu's patch.exe I get an elevation dialog from Vista. If I rename patch.exe to foo.exe it does not do this, so I assume this is one of Vista's "heuristics". Does anyone know how to disable this? It's driving me nuts and the Googles aren't helping. Or should I add a manifest just for patch.exe to tell the system NOT to try to elevate this? Will that work, and if so how do you

Avoiding UAC but launching an elevated process using a windows service

点点圈 提交于 2019-11-27 08:59:13
I have a non-interactive service running as a the privileged SYSTEM user on Windows machines, and I need it to launch a given executable as an elevated process. I have managed to launch a child process as SYSTEM, using WTSGetActiveConsoleSessionId(), finding a system process and duplicating it's token. Similarly, I can launch a non-elevated process as a regular user. But I need to launch the process as the regular user, but with elevated privileges - so that I don't have to show UAC, but the process is running as the appropriate user. I am not trying to bypass UAC - since the user already

UAC elevation does not allow drag and drop [duplicate]

三世轮回 提交于 2019-11-27 08:57:07
This question already has an answer here: C# Drag drop does not work on windows 7 6 answers I have a .net application where I need to elevate with admin rights due to accessing some low level win APIs. I am doing it using requestedExecutionLevel in application manifest set to requireAdministrator. The application also needs to receive drag and drop requests from windows explorer. I have tried setting uiAccess to true in manifest and complying with other requirements like authenticode signing of the application, installing in restricated location (program files) etc. The appliction is running