problem about uac-Collection of common programming errors


  • Marc Friedman
    windows windows-7 installation virtualization uac
    I’m working with some legacy applications (10-15 years old), and am trying to find guidance on the “right” way to install and run them (and any user application) on Windows 7 without requiring full Admin privileges.In other words, where executable/read-only should files go, where user-data/read-write should files go, where registry entries should go, to avoid issues with the UAC and Windows 7 file/registry virtualization during both installation and at run-time.I seem to remember, years ago, a M

  • blak3r
    c# .net windows-vista installer uac
    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 to run on startup so they go back into preferences and re-enable. Apparently, this is a pretty common gripe with .NET that there isn’t a native way to create

  • Milan
    ant uac
    I have Apache Ant file (build.xml) which is set to create automatic backup of my production server. It is set to stop Apache server & MSSQL2000 – backup everything and start both services (and their dependencies) again. It is working fine under the old WIN 2008 server but not under the WIN8. When the .bat file is executed to run the Ant processes it opens the CMD (as it should) but none of the stop/start operation execute properly. I am getting “Access is denied.” response.This is the CMD ou

  • Ian Boyd
    clickonce uac cas
    I have a ClickOnce app that needs to execute regasm, to register an assembly that it just updated. If UAC is turned off, it works fine. If UAC is turned on, however, regsam’s exit code is 100. If I run the same command in a cmd prompt, it fails with a message about needing admin privileges. If I use the run as admin option when I open the cmd prompt, it succeeds.I tried changing asInvoker to highestAvailable in the manifest, which works locally, but ClickOnce refuses to publish it that way.

  • Quinxy von Besiex
    c# windows uac
    My code is running elevated but nothing can see/execute c:\windows\system32\rstrui.exe (System Restore Point UI).I double checked to make sure the code really was running elevated (it is), and I’ve tested with File.Exist() and Directory.GetFiles() and System.Diagnostics.Process.Start(); file not found is what is returned. The program is really there, I can really run it, I can copy/paste the path to DOS and list it, execute it (no hidden spaces, etc.).Any ideas?THE SOLUTION:Tim (below) gave me t

  • Victor Haydin
    wix uac ngen
    I am trying to include ngen to my installer using this article. I want to run ngen synchronously (with priority=0) during installation, but it requires administrative rights to run. So, now I have following message in the log:MSI (s) (74:2C) [18:30:14:310]: Invoking remote custom action. DLL: C:\windows\Installer\MSI60B0.tmp, Entrypoint: ExecNetFx ExecNetFx: Microsoft (R) CLR Native Image Generator – Version 4.0.30319.1 ExecNetFx: Copyright (c) Microsoft Corporation. All rights reserved. Exec

  • helloworld922
    java jni uac
    I have a DLL which has certain functionality which requires UAC elevated privileges in order to work properly. I changed the manifest file to level=requireAdministrator, but when I load the dll in Java the functionality fails.Note that loading the dll works, but the implementation of the native methods execute as if there’s no elevated privileges (doesn’t even ask me to use UAC elevated privileges).The setup consists of a runnable jar file (exported using Eclipse) with the native library file in

  • wonderer
    c windows uac windows-vista createdesktop
    I asked this in http://stackoverflow.com/questions/1188396/createdesktop-with-vista-uac-c-windows I set a bounty but in trying to vote down the only answer the “accept” was pressed by mistake (i’ve been awake for more than 48 hs). so I am asking it again.I’m using CreateDesktop() to create a temporary desktop where an application will run, perform a cleanup action (while remaining out of the way) and terminate. I’m closing that desktop once the application is gone. Everything is fine when using

  • Peter O.
    winapi windows-7 windows-vista uac special-folders
    I noticed that in my application, most compatibility problems were caused by ‘access denied’ for some folders, such as:Application Data [C:\ProgramData] Desktop [C:\Users\Public\Desktop] Documents [C:\Users\Public\Documents] Favorites [C:\Users\Public\Favorites] Start Menu [C:\ProgramData\Microsoft\Windows\Start Menu] Templates [C:\ProgramData\Microsoft\Windows\Templates]Does Windows 7 have the same problem as Vista? With help from the members of Stack Overflow, I know that on Vista I can use CS

  • Echilon
    windows-installer uac uninstall publisher
    I have signed my MSI installer with a valid certificate. When I install this MSI the UAC prompts and display the Publisher name properly. However, when I uninstall the MSI UAC prompts saying “Unknown Publisher”.If checked in the C:\Windows\Installer folder for the cached installer and it doesn’t have the certificate!So why doesn’t it keep the certificate for the cached installer?

  • HopelessN00b
    windows-7 security permissions file-management uac
    One of our customers has just found a problem when trying to create a file on the root of the C Drive (C:\), on a Windows 7 Professional PC.I know they shouldn’t be keeping files here, but there is a valid reason in this case, so I’ve relaxed the security on C:\ by giving the users group users modify permissions.Before I relaxed the security, the user was receiving access denied, but now they are receiving the message:An unexpected error is keeping you from creating the file. If you continue to

  • Dercsár
    uac
    Have a Win 7 box, SP1, with default UAC settings (just for the feeling). When I run something as Administrator, the UAC elevation prompt comes up, asking for an admin password. That’s designed behaviour (I wouldn’t call it normal, though).What bothers me is that the “Ok” button is selected by default. So if some sneaky badware gets to run on my box I have a chance of accidentally hitting Enter and thus allowing it run in privileged mode. I would expect it to default to “Cancel” or even start wit

  • leeand00
    windows-7 dropbox administrator uac
    I just tried to install Dropbox on a users Windows 7 64 bit machine at work…and the installation program asked for my administrator password. When I type it in I get the error: “Dropbox requires administrator rights to continue, but could notelevate (unexpected error 6)”and the program exits.I tried holding down shift and running it as administrator and the same thing happens. I also installed it by logging out of the users account and logging back in as the administrator. This succeeds, bu

  • Dror Helper
    .net security uac
    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 application to run as administrator but that’s not good enough because if the application will run without privileges it would crash on my users machines. Is t

  • Daniel Stutzbach
    windows windows-7 permissions uac manifest
    I’ve written a program with a manifest that includes requireAdministrator. On Windows 7 systems with UAC enabled, Windows pops up a dialog asking for permissions, as it should. Works great.If a user starts my program by right-clicking it and choosing “Run as administrator”, then Windows 7 also pops up a dialog asking for permissions. However, there are some slight differences in how my program operates in some of the more esoteric parts of my program.So what are the differences between “Run a

  • Suma
    visual-studio windows-vista uac
    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 s

  • Bopha
    c# windows-7 uac
    I have C# executable that I want to launch on Windows 7 without the dialogbox asking for run-as-administrator.. So here is my code inside the program that launches the C# executable named testApp.exe.Process testApp = new Process(); testApp.StartInfo.FileName = “C:\\Program Files\\Common Files\\testApp.exe”; testApp.Start();I also create the minfest for both programs. app.manifest for testApp.exe and app.manifest for the program that launches testApp.exe, and then I change the following line i

  • Kate Gregory
    visual-studio debugging windows-vista uac
    I have a web application that I’ve always been able to run in Visual Studio and it debugs just fine (breakpoints work, I can pause execution, etc). Recently, the behavior changed suddenly, and a few things happen:I start debugging, it lauches IE and loads the application, but after a few seconds (sometimes the page hasn’t even displayed yet), Visual Studio acts as if debugging has stopped – I’m able to edit code in VS again, and the “Play” button on the toolbar is enabled. The application contin

  • Howard Guo
    windows uac
    Coming from a Linux/Unix background, I cannot understand how UAC works in Windows.I heard that UAC works like sudo. My Linux application can do some other work before calling sudo.But in Windows, it appears that all applications which require UAC confirmation must have UAC granted before doing any actual work at all! I run an application, it asks me for UAC confirmation and I refuse it – the application will simply not run.So does UAC work like this?sudo su ./run_appRather than:./do_work1 sudo s

  • Synetech
    windows scheduled-tasks uac autorun
    There’s a program that I want to be automatically run on startup, but because it requires elevated privileges, UAC interferes with it auto-running.I used the Task Scheduler method of working around this issue; I created a task for it, then created a shortcut to run the task, set it to be minimized, and put it in the Startup folder in the Start Menu.It works as expected for the most part; the program runs automatically on startup without prompt and minimizes to the tray.There is however a problem

  • Jonas
    windows-vista java eclipse uac jre
    Today, I can not start Eclipse anymore. It worked fine yesterday, then I got a few Windows Updates before turning off the computer. And I also updated to the latest Java RE 1.6_u20 yesterday, but Eclipse has worked fine after that.When I start Eclipse 3.4 today, the UAC ask me for the Administrator password, and then the Eclipse Splash shows up for a short while, after that nothing more happens. And If I try to start Eclipse 3.5, the same thing happens except the UAC.What can the problem be? How

  • Samir
    crash uac manifest screensaver
    Does screen saver require any manifest file? I’m renaming the .exe to .scr file.Right now i am not using any manifest file for the screen saver. But if if UAC is enabled, my screen saver crashes. How to by pass this UAC thing ?

  • Kate Gregory
    windows-7 permissions wmi uac
    I’m adding WMI publishing to a .net framework 3.5 based windows service that is running under the ‘network service’ account.According to a document I came across on MSDN, the ‘network service’ account should by default have WMI publishing permissions. (“By default, the following users and groups are allowed to publish data and events: … Network Service, …”)However, when the service calls Instrumentation.Publish(myStatusClassInstance), it throws a DirectoryNotFoundException;System.IO.Director

  • MusiGenesis
    c# windows-vista permissions uac
    I’m working on updating one of our applications. It must use .NET 2.0. One portion creates a file on the Desktop using FileStream fs = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory), FileMode.Create);But I get an UnauthorizedAccessException in Windows 7 (and Vista too, I’m assuming, though I haven’t tested that yet). I looked into elevation (not for the entire program, but for a separate assembly which would create the file and perform actions on it); how

  • Kate Gregory
    c++ windows visual-c++ windows-7 uac
    I am using Windows 7 and I have to run one program in that windows but that program working in Windows XP. This is a Visual C++ program and I am using Visual Studio 2008 for this. When I am running my application, it does not throw any errors, but it does not create a directory in “c:\program files\”. So can anyone help me to create directory and exe file?This is the code I am using:char szAppPath[MAX_PATH]; char szFileName[MAX_PATH]; DWORD dwResult; WIN32_FIND_DATA FindFileData; HANDLE hFind;dw

  • Coding Mash
    c++ integer type-conversion uac
    int left = std::numeric_limits<int>::min(); int right = -1; //the code below instead of give one more than int_max gives: 18446744071562067968 unsigned long long result = left * right;I’ve tried to look up UAC but even according to UAC rules this should produce correct output. Any ideas why the result is incorrect?

  • Jeff Shepler
    c# windows uac impersonation
    I have a class library that keeps system-wide configuration data in the registry (HKLM\Software\XXX). This library is used in various applications (services, windows forms, web apps, console apps) on various versions of Windows (XP, 2003, 7, 2008 R2). Because of this, the identity of the app is not consistent and may not even be a member of the machine’s Administrators group. So I’ve created an AD domain admin user and do impersonation to gain write access to the registry. This works perfectly i

  • Jayan
    java windows file uac
    I searched many of the similar questions but could not solve my problem. I am trying to write something in a file, which gives me erroe.My codetry {File f = new File(file_name);f.createNewFile();//System.out.println(“Hello”);f.setWritable(true);FileWriter fstream = new FileWriter(f);BufferedWriter out = new BufferedWriter(fstream);ListIterator<String> itr = account.listIterator();//account is a List objectwhile (itr.hasNext()) {String element = itr.next();out.write(element);out.newLine();}

  • mgttlinger
    .net uac
    I have an exe that a normal user will run, but it needs to merge a REG file, which requires UAC popup asking for the admin password, which I do not want to provide to user.Is there a way for me to pass in the password in process.StartInfo so UAC doesn’t have to ask for the password?If I do this:process.StartInfo.Domain = “XYZ”; process.StartInfo.UserName = “admin”; process.StartInfo.Password = “”;It tells me I need to be evelated.I have also tried to impersonate the admin account, then:proc

  • Jonas
    java windows uac preferences securityexception
    How can I write system preferences with Java, using Preferences.systemRoot()?I tried with:Preferences preferences = Preferences.systemRoot(); preferences.put(“/myapplication/databasepath”, pathToDatabase);But I got this error message:2010-maj-29 19:02:50 java.util.prefs.WindowsPreferences openKey VARNING: Could not open windows registry node Software\JavaSoft\Prefs at root 0x80000002. Windows RegOpenKey(…) returned error code 5. Exception in thread “AWT-EventQueue-0” java.lang.SecurityExceptio

Web site is in building

I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money