uac

Why does running with elevated privileges force the use of UNC paths?

Why does running with elevated privileges force the use of UNC paths? I need to elevate my process AND keep the drive mappings I have. Yet when I run elevated the mappings are replaced with the UNC path. For example: textBoxPath.Text = Application.StartupPath; returns "F:\myProgram\tools" when run normally. But when run elevated it re...

Is there a way to turn ON UAC programmatically with C#?

Is there a way to turn ON UAC programmatically with C#? I know, everyone seems to want to know how to turn it off. I want to be able to turn it on and restart the system. Thanks ...

How do I ask for an elevation for Registry access to HKLM?

How do I ask for an elevation for Registry access to HKLM? I'd like to add EnableLinkedConnections to "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\". I also don't want to use a manifest file. Ive tried the below code but it doesn't seem to help. RegistryPermission f = new RegistryPermission( RegistryP...

Pimp my UAC and a few questions about it

Hi, I have this application that need to do some things in protected paths (like %PROGRAMFILES%), I know that I should be using %APPDATA%, but I can't change that for now. I have isolated all the things that could require UAC to show up on another project, here's a sample code: using System; using System.Diagnostics; using System.IO; u...

Check Installer Permissions with Windows Visual Studio 2008 C#

Lots of Installer questions, but I can't find the answer to what I want. I've got an installer that can log in an Administrator account to continue the setup, but I don't know how to check the current user to see if he/she already has Administrator or Power User privileges. How can I check to see what kind of permissions the curren...

How do I grant a service user sufficient rights to create registry keys in windows 7

I have an application that runs as a service, and dynamically creates and publishes windows performance (perfmon) counters. When I run the application under my own account (as a service) which has administrative privileges, I get the following error: 714: The specified registry key is referenced by a predefined handle. When I run the a...

tortoisesvn context menu's and windows 7 / Vista UAC

Hi, I'm using Windows 7 and Tortoise SVN. (although the same applies to Vista) If, for exampe, I want to download a repo by using the context menu option "SVN Checkout", and want to checkout the files inetpub folder (UAC protected), tortoise SVN cannot due to UAC and gives an "Access Denied" error. How can I run Tortoise SVN via the ...

How do I control my application's name in the UAC dialog?

I would like to control the name of my application as it appears in the UAC dialog. Right now it shows up as something like "MyCompany.MyApp.exe"; I would prefer something like "MyApp Pro". In other words, I would like a short, friendly phrase instead of the raw EXE file name. I noticed that MMC.EXE appears in the UAC dialog as "Microso...

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

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

How to change info on UAC prompt?

On Windows Vista, with UAC enabled, everytime a program that requires administrative priviledges starts, a UAC prompt is displayed. In the box, there are two fields - name and author. How can those be customized? ...

Writing drive C: in Windows 7/Vista

I am developing an application that saves its settings in the install folder. If I install the app in the Program Files on drive C: and attempt to write the settings file I get an exception and that's it. I know that the User Account Control (UAC) migth be the one that is not letting my app modify the content of the file. I need help w...

UAC - embedding manifest for .net

C++ projects have a linker option to embed manifest to require UAC elevation (/MANIFESTUAC:level) . Is there any such option for .net projects? ...

Write Access to Program Files folder

Hi, my application include a self-updater executable that is used to update the application. One of the first steps the updater is performing is to check that it does have write permission to the application folder IPermission perm = new FileIOPermission(FileIOPermissionAccess.AllAccess, _localApplicationCodebase); if (...

TortoiseGit Fail to install context menu on Windows 7

I tried to install TortoiseGit on Windows 7. Installation seemed successful, but TortoiseGit context menu does not show up after reboot. What should I do to install TortoiseGit context menu? P.S. 1. msysgit is installed and successfully configured in TortoiseGit, if it's relevant. 2. uac is not turned off. Thanks ...

RUNASADMIN in Registry doesnt seem to work in Windows 7

For a while now the installer for my program has used the below code to make my app run with administer privileges. But it seems to have no affect under Windows 7. In Vista it worked beautifully. If I right click the shortcut and tell it to run as Administer, the program will start fine. But by using the below, code it should be made to ...

Issue with .cab file (ActiveX) installation on Windows Vista and 7

I have made an ActiveX control and have made its .cab file for automatic installation on client machine using Internet Explorer.. It working fine of Windows XP, but on windows Vista and Windows 7 its installation is blocked by UAC (User account control), and when I disable it, all things works fine... I have signed my .cab file with a ce...

Run .NET application as administrator

Since Vista & windows 7 came out some of my .NET application has started throwing security exceptions. I've noticed that some applications (i.e. my antivirus, control panel) have a small shield and when I run these applications administrator privileges are automatically requested from me by windows. I know that as a user I can set the...

C# 2005 console application always requires elevated privileges

Hi, I am trying to build an automation application in C# 2005 express edition under windows vista. Problem is, Whenever I try to run this application, either from IDE or directly compiled executable under vista, it asks for elevated admin privileges, same executable runs under XP normally though! I'm unable to understand if this proble...

Copy to Program Files under Windows Vista/7

Hi, I have written a wizard in c++ which installs some files to the program files folder under windows. As I understand, I need Admin rights to write to program files under Vista/7. So my question is: Is there a way to turn on Admin rights while the application is running respectively only for one wizard page? Or do I have to start anot...

Can you determine if Vista UAC allows writing to a directory without elevation in java?

Here is the scenario. I have an application which writes a configuration file in its directory (user.dir). When the user cannot write to that directory due to UAC issues, I would like to change that to write to user.home/.appname/. The problem is that Windows really lies to my application and writes to user.dir which is in the Program Fi...