uac

How to add the UAC shield icon to program that still must target XP?

I have a program that still must target Windows XP (_WIN32_WINNT 0x501), as most of our customers still use XP. However, we have been shipping Vista for a while, and are now pushing Windows 7 upgrades. For the software to work correctly on the newer OSs, there are a couple operations that require UAC elevation. I have the elevation cod...

Win C#: Run app as administrator without UAC prompt

Hello, I need one of my .exe to always run as administrator without UAC prompt. My program will be installed with setup, which will have for one time admin rights, and I need to perform such step in this setup that my exe will be always executed as admin without UAC prompt. I've found 2 solutions so far: 1. Use custom service, which w...

How do I create a shortcut to CMD.EXE that asks for elevation using INNO Setup?

Hi, using INNO Setup I currently have the following entry under the [ICONS] section: Name: "{group}\My App\My App - Command Prompt"; Filename: "cmd.exe"; WorkingDir: "{app}" This shortcut launches a command prompt straight into my application's folder. Unfortunately it isn't launched as elevated which means the commands the user run...

Connect to an elevated COM server from a non-elevated process

We have a program which launches a child process that hosts a local COM server, which for various reasons must be launched elevated. Everything works fine so long as both the parent and the child process are elevated. However, we also want to run when the parent process is non-elevated. Launching the child process results in a UAC dialo...

How do you deal with UAC when creating a process as a different user?

I am having an issue with UAC and executing a non interactive process as a different user (APIs such as CreateProcessAsUser or CreateProcessWithLogonW). My program is intended to do the following: 1) Create a new windows user account (check, works correctly) 2) Create a non interactive child process as new user account (fails when UAC...

Creating compound applications in Windows 7

I need to port a suite of Windows applications (running under XP with little security turned on) to Windows 7 with various levels of security, depending on how our clients may configure it. Each functional area is a seperate executable or DLL that is downloaded and registered by a central 'compound' application. This means that the diffe...

Vista/7 UAC: how to lower process privileges

Hi all, Is it possible for a process to lower itself from elevated UAC permission back to standard user? If not can the elevated process launch its copy with standard user token and then kill itself? Any code examples (C# preferred)? Details: Problem: - user installs my product (written in C#) - the installer elevates its UAC permissi...

.NET 2.0 Process Elevation for App Installation

We have an application written in both C++ and .NET that installs for all users in the Program Files folder. This application downloads new versions of itself (as MSI installers) and spawns the new installer process to replace itself. The install process as it exists today: Copy an install manager app (C#, .NET 2.0) to the temp direct...

Where should I store shared resources between LocalSystem and regular user with UAC?

My application consists of two parts: A Windows Service running under the LocalSystem account and a client process running under the currently logged in regular user. I need to deploy the application across Windows versions from XP up to Win7. The client will retrieve files from the web and collect user data from the user. The servic...

How to launch a Windows service network process to listen to a port on a localhost socket that is visible to a normal user under UAC?

Here's the code (in a standard TService in Delphi): const ProcessExe = 'MyNetApp.exe'; function RunService: Boolean; var StartInfo : TStartupInfo; ProcInfo : TProcessInformation; CreateOK : Boolean; begin CreateOK := false; FillChar(StartInfo,SizeOf(TStartupInfo),#0); FillChar(ProcInfo,SizeOf(TProcessInformation),#0); ...

WMI: Editing the Registry Remotely

I'm trying to use the following code (poorly written, but it's just a proof of concept) to edit the registry of a computer on a domain. I have a domain account, and I've verified that the domain admin group is present in the local admin group on the machines I'm attempting to affect. I've connected to these other machines to perform ot...

What parts of .NET require administrative priviliges to be executed?

Which parts of the framework require a user to be more than a Standard User? The reason I'm asking is because I'm trying to compile a list of possible issues with our existing applications when migrating to Windows 7. Now, I can think of a few things myself: Writing to Eventlog Writing to Registry Keys outside of Current_User scope Ge...

Missing UAC shield overlay on desktop shortcut icon when created by msi created from VS 2008

I created a setup program to deploy my VBNet program using Visual Studio 2008. Inside this setup program I created a shortcut to the "primary output" to be installed on the user desktop. Now, everything is working correctly. The program is installed under "C:\Program Files" and the shortcut is created on the desktop. Also, when I use th...

[C#] Running elevated applications on user login with UAC?

I need to start a program every time the user logs in, but I cannot do this without being met by a UAC dialog asking for permissions for that application. Is there any way to have an application start up on user login without the user having to answer the UAC prompt? I was thinking about running a service, but this would be a last resort...

Why is the Windows Installer RemoveFiles action failing when User Account Control is enabled?

I have noticed some strange behaviour with our application's installer which I am struggling to understand. I have managed to reproduce the behaviour with a simple test installer so I will use this to explain what is going on. The installer is per-machine and installs a single file into a directory underneath "Program Files". The direct...

Windows 7 UAC elevation

I have a single thread that I'd like to run as an administrator in my application. The rest of the application I can happily run as the default user level (asInvoker). Is this possible? I notice there is an "ImpersonateLoggedOnUser" function. Can I somehow use this to log the administrator on and then get the thread to impersonate th...

Java Robot class and UAC

I am using the Java Robot class to take screenshots, my problem is that in W7 when the UAC dialog is shown (i right click on any application and select run as Admin) it will not appear in the screen shot or the whole screen is just black. Running my application with admin rights or as a service does not solve the problem. Please, does an...

Display UAC shield icon on a ToolStripItem

Hi, is there a recommended way (like sending BCM_SETSHIELD to a button control) to display the UAC Shield icon on a ToolStripItem? ToolStripItem is not a control anyway, so i wonder what the best-practise for that is. Thanks. ...

setting UAC settings of a file in C#

Hi guys. i want to give a file(already present on the client computer .exe) permissions to always execute with administrative permissions. please note that the file i wants to give permissions is already on target machine. and i want to change permissions of that file through another program written in c# and it has administrative per...

Can I allow a write access to a particular registry key without elevation?

I develop an extension for Visual Studio 2005, 2008, and 2010. The Visual Studio 2005 SDK requires write access to the following registry key during builds. The normal way to handle this run Visual Studio with elevated privileges. The entire issue can be avoided if there's some way I can set permissions to allow access to this particular...