uac

How do I check if my program is ran by user as administrator (Vista/Win7, C++)

I saw IsInRole method but I can't find information on how to use it with C++. ...

Upload File via Excel AddOn

Hi, I need to develop a Add on for Excel (2003 and greater), it must upload the excel file when click the Save Button (with the event Application_DocumentBeforeSave). My question is how can I do that? I try with Net.WebClient UploadFile and runs OK on WinXP but doesnt work on Windows Vista and Windows 7, may be the UAC or some securi...

Run a CLR application at medium UAC integrity level?

I've been developing a C# (WinForms) application that uses the Office 2007 PIAs to integrate with Outlook 2007. In my dev environment, UAC is disabled and all of my functionality works, but my test environment is Vista 32-bit with UAC enabled. In the test environment, Outlook runs at medium integrity level by default (when started by th...

Ask user to restart application with administrative privileges like VS debugger does

I am in the process of developing an application which uses a legacy USB driver. For some reason the developers of the legacy USB driver decided to write information to the registry and this process requires me to have administrative privileges for my application. Now, the USB functionality that uses the registry should be only done by...

Elevating privileges doesn't work with UseShellExecute=false

I want to start a child process (indeed the same, console app) with elevated privileges but with hidden window. I do next: var info = new ProcessStartInfo(Assembly.GetEntryAssembly().Location) { UseShellExecute = true, // ! Verb = "runas", }; var process = new Process { StartInfo = info }; process.Start(); and this wor...

How to write files in c# as an administrator ?

Hi, I have c# program which writes an xml file to "C:" disk. I published my program as one click package because it's for test purpose only. But the problem is the one click package doesn't have "run as admin" option. So how can I solve this problem ? Any idea ? ...

WiX: make symbolic link with UAC enabled

Hello. I want to execute a custom action in a Windows Installer (with WiX script) that makes symbolic links at the end of installation. mklink requires administrator privilege, as the installer restricts. This is what I wrote: <CustomAction Id="mklink_cmdline" Property="QtExecCmdLine" Value='"[SystemFolder]cmd.exe" /c mklink "[SystemFol...

C# IPC Between BHO and Service

I can't seem to find a way to communicate between my IE C# BHO and a C# console app running as SYSTEM. So far I have tried using Remoting and EventWaitHandle, but both give me "access denied" errors when I have UAC turned on the default setting in Win 7. I have been able to have a console app that communicates with the service using bo...

Default access rights of files and directories

I have an application that is installed on Vista PC's by a user with elevated user rights (and administrator via UAC elevation prompt). The installer writes some files to a folder in the %APPDATA% folder. When the user (without elevated user rights) run the application, the files (and created folders) in the shared %APPDATA% (c:\Progr...

How could I set a global hook by a GUI without UAC prompt on Win7??

Dear all, I want to set a global hook by SetWindowsHookEx. The hook is wrapped in hook.dll and is registered by a GUI window app.exe. Everything works fine on window NT/xp. But on Win7, how could I start app.exe process without UAC prompt and it can successfully load hook.dll to register gloal hook on Win7?? I use VC2005. Any ideas are ...

Windows 7 : Set "Run as Administrator" for shortcut automaticly

In Windows 7 (Vista too maybe) you can set a property of a desktop shortcut to "Run as Administrator". So every time the shortcut is used to application is invoked with Administrator privileges or the use is asked for an admin account. I know I can request/force Administrator privileges with a manifest file for my application but I need...

Why I get Access denied when try to read file from ProgramFiles/MyApp?

Hi, I am trying to read from a config file in ProgramFiles/MyApp but in Windows 7 it throws an exception for Access denied, it is the same and for a file in ProgrammData/MyApp: fileStream = new FileStream(this.StorageName, FileMode.Open, FileAccess.Read); Is not it allowed to read only from these folders? ...

Can a Java program put a DLL in C:\Windows?

Hi, I'm making an executable JAR that uses the RxTx serial library. It requires access to rxtxSerial.dll and I want the JAR to put it there automatically. That way I don't need an installer -- just a standalone JAR. Can this be done? When I call new FileOutputStream(new File("C:/Windows/rxtxSerial.dll")), I get the following excepti...

C# .NET - how to determine if directory is writable, with or without UAC?

I'm working on a piece of software that needs to copy a file to a given directory on the filesystem. It needs to work on both UAC-aware OSs (Vista, 7) as well as XP. To get around the issue of writing to a directory where UAC elevation is required, the app actually kicks off another process with a manifest that states that UAC is require...

How to launch program with user permissions instead of active permissions

I have a C# application which runs and displays a tray icon. I have an installer for my tray application which launches the application after installation. The installer requires admin permissions whereas the tray icon must be run with normal permissions. My installer currently breaks this - when the installed tray application is launche...

Enable drag&drop from explorer to Run-As-Administrator application

I built a winforms application, and implemented drag&drop functionality. this functionality works great in WinXP or in Win7 from Run-As-Administrator applications. The problems become when tring to drag from non-admin application in Win7 to my program, it just not working. I understand this because the OS filtering the messages. I foun...

requestedExecutionLevel in manifest file and failing CopyFile() function

Just trying to copy a file using CopyFile() function from the current directory to C:\windows\system32\drivers. I wrote also manifest with "requestedExecutionLevel level="highestAvailable"" in it and I run mt to add it to resulting executable. When I try to run it, Windows 7 UAC dialog popping out, I press "Yes", but CopyFile() returni...

How to determine why application is prompting for elevation

When launching my executable, Windows is prompting for elevation, when it shouldn't be. How can i figure out why Windows is prompting me to elevate my executable on launch? Notes: there is no manifest resource (asking for asAdministrator, or otherwise) there is no manifest file the compatibilty tab (for all users and just me) has the...

UAC ask permission programmatically

I have an application that uses an COM file. Sometimes this file has not been registered by regsvr32 and i'd like to program a function that if the file cannot be loaded it tries to register it and retry. To do so i'd need admin privileges, so i'd like to ask if there's a way to show the UAC "run as administrator" question to the user at...

Newly compiled application requires UAC/elevation?

hi! I have a system, I set it up as a normal with UAC, and in my delphi environment I compile my project named ka.exe, I create a installshield project for it. setup and everything completes ok! but whenever I start my program, it requires elevation and I don't have any clue why. just to be sure installshield is not playing mindgames ...