uac

Disable Vista UAC per-application, or elevate privileges without prompt?

蹲街弑〆低调 提交于 2019-11-30 14:18:02
问题 I have an app that normal users need to be able to run, but requires administrator privileges to actually function. I tried to make the shortcut that my users run it with "Run as administrator" but this just causes a UAC prompt whenever they try to run the app. Is there any way to elevate privileges programatically, without my users needing to go through a UAC prompt and/or knowing an administrator password? From a security standpoint, I understand that most applications shouldn't be allowed

How to display UAC prompt for file save to restricted location using c#?

雨燕双飞 提交于 2019-11-30 13:46:29
When a user saves a file from my application, they currently can't save to restricted locations (like C:). I think this is a good restriction, but I would like to provide a UAC prompt to elevate privileges and allow a user to save in a restricted area. I've seen lots of answers around this topic that involve spawning a new process with elevated privileges using 'runas'. Also, it seems like this can be done by impersonating another user. From what I understand, both of those methods require a user to provide user credentials. What I'm wanting to do is basically what Windows itself does. When

Windows 7 doesn't allow me edit files in Common Application Data folder

心不动则不痛 提交于 2019-11-30 13:00:07
I want to store some files and edit them for my software in common Application Data under Windows 7. I do not know why Windows 7 doesn't allow my software to change files unless I run them as administrator. Where can I store my files, so it won't require admin permission? You should store your application data in a subfolder under Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); . Note that this folder is user-specific. Non-Admin users do not have permission to write to the CommonApplicationData folder, because that folder does not belong to specific users. Note that you

How to determine if user is an Administrator, even if non-elevated

。_饼干妹妹 提交于 2019-11-30 12:50:11
In my C# application, I need to check if the current user is a member of the Administrators group. It needs to be compatible with both Windows XP and Windows 7. Currently, I am using the following code: bool IsAdministrator { get { WindowsIdentity identity = WindowsIdentity.GetCurrent(); WindowsPrincipal principal = new WindowsPrincipal(identity); return principal.IsInRole(WindowsBuiltInRole.Administrator); } } The problem is that this method returns false if the application is run on Windows 7 with UAC turned on as a non-elevated Administrator. How can I determine if the user is an

Disable Vista UAC per-application, or elevate privileges without prompt?

谁说我不能喝 提交于 2019-11-30 10:09:34
I have an app that normal users need to be able to run, but requires administrator privileges to actually function. I tried to make the shortcut that my users run it with "Run as administrator" but this just causes a UAC prompt whenever they try to run the app. Is there any way to elevate privileges programatically, without my users needing to go through a UAC prompt and/or knowing an administrator password? From a security standpoint, I understand that most applications shouldn't be allowed to do this, so I'm hoping there is some way to do it if I can provide a valid username/password pair,

Correct way to design around Windows UAC limitations?

大憨熊 提交于 2019-11-30 09:26:21
I found out an application I wrote does not work properly under Windows Vista/7 if UAC is enabled at any level, because it writes files to the install directory of the program, defaults to "C:\Program Files\MyProgram." If UAC is disabled (or on any other version of Windows) it works properly - I read that UAC denies applications write access to the Program Files directory by default. My question is, well, how should I write my application so that it can be used without any "rights" needed at all. I don't want users to have to run it with elevated privileges or as administrator. I just want it

How to configure Visual Studio not to give UAC prompt on each run?

£可爱£侵袭症+ 提交于 2019-11-30 09:09:57
I have switched to Vista recently and I wanted to keep UAC turned on, as I agree it increases computer security a lot. Some developer tools I use regularly require running elevated: PIX for Windows Visual Studio 2005 (elevated privileges seem to be needed for debugging and for IncrediBuild to work) mapped and substed drives: The elevated process does not seem to see the drives I have mapped in my user account. This article describes the problem, but I am not sure how could I implement its final suggestion to "map these drives in the context of the elevated login" . I have experimented with

Force an existing application to always run with UAC virtualization on

和自甴很熟 提交于 2019-11-30 08:36:12
问题 I've seen several questions that are the opposite of this; "How do I disable virtualization?" That is not my question. I want to force an application to run with virtualization enabled . I have an application that ran just fine under Windows XP, but, because it writes its configuration to its working directory (a subfolder of "C:\Program Files (x86)"), it does not work completely under Windows 7. If I use task manager to turn on UAC Virtualization, it saves its config just fine, but of course

How to detect if executable requires UAC elevation (C# pref)

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 07:39:33
问题 how can I detect if executable requires UAC elevation? So far I came to two ideas: picture recognition of executable's icon to check if UAC shield icon is on it and information from wikipedia: http://en.wikipedia.org/wiki/User_Account_Control it is possible to programmatically detect if an executable will require elevation by using CreateProcess() and setting the dwCreationFlags parameter to CREATE_SUSPENDED. If elevation is required, then ERROR_ELEVATION_REQUIRED will be returned.[16] If

Looking for Delphi 7 code to detect if a program is started with administrator rights?

一笑奈何 提交于 2019-11-30 07:21:38
I am looking for working ( obviously ) Delphi 7 code so I can check whether my program is started with administrator rights . Thanks in advance [--- IMPORTANT UPDATE ---] Having reviewed the code in the answers so far, I realise that my question maybe is not so clear, or at least is not complete: I want to know whether my Delphi 7 program is started with the 'Run as admin' check box set . In other words: I want to know whether it is possible for my Delphi 7 program to create/update files in the c:\Program Files... folders . Just checking if you have administrator rights is not enough for this.