uac

Save File to Desktop in Vista/Windows 7 in .NET 2.0

社会主义新天地 提交于 2019-12-18 05:04:08
问题 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);

Vista UAC - Trouble Mapping Network Drives

冷暖自知 提交于 2019-12-18 04:12:50
问题 We have an application that programmatically maps network drives. On Vista with UAC on, we get some strange issues. Our application maps the drive non-elevated, so if the user browses explorer and double clicks to run an exe, it prompts for UAC. So when they approve it, it prompts for a username/password for the share... Strange since the credentials are saved. It turns out, an elevated process cannot access a mapped drive that was mapped from a non-elevated process. To see this issue in

Write in “ProgramData” folder (W7 and Vista) .NET

久未见 提交于 2019-12-18 03:55:17
问题 I install my app under "Program Files" directory. And I install data, under "ProgramData" directory: Environment.SpecialFolder.CommonApplicationData In programData I have created folder to save data. Example: C:\ProgramData\MyApp\MyData\here I have files and folders Under XP all runs fine. But not under Vista or W7 OS. I can read files in this directory, but I can not write files, I can not create new files, etc. The user is logged as Admin. Where I can store data without restrictions? I need

P/Invoke tutorials?

一笑奈何 提交于 2019-12-17 18:43:56
问题 Does anyone know of a good tutorial/e-book that goes in depth on the System.Runtime.InteropServices namespace? I just got through reading this tutorial on how to make the UAC shield show up in a button and now I really want to learn this. P.S. How do look in the windows system files to know that a method exist to show a UAC shield in a button? 回答1: As for your p.s., the code you need is in the information you provided. You use the SendMessage method to send the BCM_SETSHIELD message to a

How can I get elevated permissions (UAC) via impersonation under a non-interactive login?

删除回忆录丶 提交于 2019-12-17 16:45:10
问题 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

How can I get elevated permissions (UAC) via impersonation under a non-interactive login?

你。 提交于 2019-12-17 16:45:05
问题 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

How to write to the user's My Documents directory with installer when the user used 'Run As Administrator'

ぃ、小莉子 提交于 2019-12-17 16:39:39
问题 I have a program that needs to create files in the My Document directory on installation. This is a strict fixed requirement, there is no changing this. Problem is that if the user does 'Run As Administrator' on the Setup file, innosetups constant {userdocs} points to the Administrator's document directory not the original logged in user. So, Googled and found this: Install files to original user's My Docs folder via Inno Setup on Windows Vista/7 The answer is wrong, however, because

How to detect file redirection to the Windows VirtualStore?

跟風遠走 提交于 2019-12-17 16:13:43
问题 Since the release of Win Vista, Microsoft introduced file virtualization for legacy applications running as 32bit processes. Released as part of Microsoft's User Account Control (UAC) any legacy applications attempting to write to any locations considered protected by the operating system are redirected to the VirtualStore. At this point, steps have been taken to ensure that the application in question now runs as a 64bit process that is UAC aware, however, this does little to address the

How to embed a manifest file at compile time in Visual Studio 2010

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 15:58:24
问题 I have a project with a manifest file with the following node: <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> ...meaning I want it to only run "as administrator" by default. from searching around, to make this work I have two options: "Embed" it. deploy the manifest file with the exe, and name it YourProject.exe.manifest. I've tried option 2, and when I run my app it doesn't ask for admin rights? So, how do I do option 1 in VS2010? I've heard of mt.exe, but this is

Can we get the UAC prompt to show only once?

感情迁移 提交于 2019-12-17 14:51:35
问题 Is there a way for an app to present the user with the UAC prompt only once, upon first running. Thereafter, no further prompting. In other words, I understand that our app needs the user's UAC permission to do certain things. And that's fine. But we don't want it to have to keep asking on every occasion it runs. Can the user give permission to our app for all time? Or does what I am asking violate the fundamentals of UAC? We are working with .NET and Windows 7 回答1: The answer to your