uac

(C#) How do you check if a path is a protected path in Windows that requires elevation to modify?

We have a folder where our app will be potentially reading, writing and creating/deleting files on, and while we can default to a safe location, we allow the user to select a different directory. How can we check if the directory they select is "safe"? We'd like to not require admin elevation at runtime, and this path will be used fo...

Windows Media Center Application and UAC

I'm currently trying to write a Windows Media Center Application (Vista) that can restart a service with UAC enabled. Everything works fine when UAC is disabled but as soon as UAC is enabled I get an Access is Denied error. I believe this is because the Window Media Center applications are running under the Windows Media Center process ...

start service with out invoking uac

I have noticed some applications (like steam) are able to start/stop services as a normal user with out invoking the uac control. Does any one know how to do it? OS: Vista/Win 7 Visual Studio 2005 C++ . Edit: I was playing around with the steam service last night trying to work out how it is different. If i put my service exe where th...

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

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 ne...

Access denied when trying to copy file Windows Vista

I have this batch that needs to run that the user has to execute that will copy a simple xml file. However, everything works fine on windows 2000/XP. However, on windows Vista I get an error 'Access Denied". Even when I try and copy the file just using windows explorer on Vista I get the same error. Is there anything I can do to make...

About Mutex object in Vista

My OS is Vista with UAC turned on, I create a global Mutex object in Server side, then my AP with UI want to use CreateMutex with same name to get the Mutex object which has been created in server, but the function tell me I don't have right to access it. How can I do it? ...

How do I drag from Explorer into Visual Studio without turning off UAC?

Surely there is a setting somewhere that can stop the stupid UAC issues blocking my drag and drop operation. Visual Studio has to run in admin mode for half the things I do and Explorer shouldn't have to run in some fancy admin mode just to get around this issue. I just want to tell UAC to do its thing normally but bugger off when inter...

Network Shares with WIndows 2008 and UAC

I am trying to create a network share during an install on Window Server 2008 and I have been running into UAC problems. It seems that even though I am running as administrator during the installation process the batch file run by the installer can not create the share. Is there a way to accomplish this? ...

How to prevent "This program might not have installed correctly" messages on Vista

I have a product setup executable that copies some files to the user's hard drive. It's not a typical installer in the normal sense (it doesn't add anything to the Start Menu or Program Files folders). Each time the setup program is run on Vista, after the exe terminates, Vista produces a task dialog: This program might not have inst...

Delphi: Prompt for UAC elevation when needed

We need to change some settings to the HKEY_LOCAL_MACHINE at runtime. Is it possible to prompt for uac elevation if needed at runtime, or do I have to launch a second elevated process to do 'the dirty work'? ...

Can I use ChangeWindowMessageFilter to receive DocumentComplete events from Protected Mode IE?

In my app, I want to open a new IE window, then receive and process DocumentComplete and NavigateComplete2 events fired from the new opened IE. In XP, everything works fine. In Vista, the new IE is running in Protected Mode, so my app is not able to receive DocumentCompelte event from the IE. I do not want to change any security level,...

Detecting registry virtualization

I have a set of C# (v2) apps and I am struggling with registry virtualization in Win7 (and to a lesser extent Vista). I have a shared registry configuration area that my applications need to access in HKLM\Software\Company... Prior to Vista, everything was just written to and read from that location as needed. The code appropriately d...

Where to store Registry data for All Users

I would like to share a small amount of data between All Users in the Windows Registry. For shared read and write access between any user that logs into the machine or a service on the machine. Is there a location where this can be done? I have tried using "HKEY_USERS\.DEFAULT\Software\" but this seems to be blocked by the Vista UAC rule...

Windows 7: Taking advantage of auto-elevation to elevate my own process?

From a July 2009 Technet article entitled Inside Windows 7 User Account Control, Mark Russinovish describes that it's possible for an application running as standard user to silently elevate and gain administrative rights: ...it's possible for third-party software running in a PA (Protected Administrator) account with standard us...

Vista: Can an EXE bypass user confirmation while invoking another EXE?

I have 2 applications written in Delphi. The first exe (with a user interface) calls another using ShellExecuteEx(), which runs as a background process. When the first exe invokes the second, one of these two things happen: When I log in as an admin, a UAC dialog comes up with the Allow/Cancel prompts. Selecting Allow continues the e...

Is it possible to UAC elevate a process without starting another process

I was wondering if it is possible for a program to prompt the user with a UAC prompt to raise it's own privileges without starting another process. All the examples I can find on the internet seem to ShellExecute "runas" which creates a new process with elevated privileges. If this is not possible then my best solution I guess would be...

How do I create add a shortcut (.lnk) for my application to the Startup folder programatically in .NET/C#

My application will have a per machine (not per user) Startup shortcut. I can create a shortcut during the installer process no problem. My problem comes when the user later removes it and then tries to re-enable. In otherwords, they turn off RunOnStartup (which deletes the Startup ink) and at a later time they decide they do want it ...

How can I copy a file as a "Standard User" in Vista (ie "An Administrative Choice Application") by prompting user for admin credentials?

I have what the UAC Development Guides refer to as a "Administrative Choice Application." If you're familiar with what this is skip to the next section. Background: I want to let a "Standard" user have the ability to select/deselect a Run On Startup option in the preferences for my application. Since my application is per machine (no...

How do I create a file in VC++ 6.0 when UAC is on?

How do I create a file in C++ when UAC is on, but with out running as administrator? I'm trying to create a text file in the following path: "C:\Programdata\Desktop" in VC++ 6.0 when Vista's UAC is on. However, Createfile(...) failed with 'permission denied'. When I run the sample application with "run as administrator" it works. But m...

UAC and Java

Is it possible to ask for elevated permissions from within a Java Application? Suggestions I've seen seem to all be centered around running an external executable or setting up a manifest to request privileges on launch. These aren't available to, for instance, applets. Is there any way to request elevation from a running application?...