强制现有应用程序始终使用 UAC 虚拟化运行 [英] Force an existing application to always run with UAC virtualization on

查看:23
本文介绍了强制现有应用程序始终使用 UAC 虚拟化运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我见过几个与此相反的问题;如何禁用虚拟化?"那不是我的问题.我想强制应用程序在虚拟化启用的情况下运行.

我有一个在 Windows XP 下运行良好的应用程序,但是,因为它将其配置写入其工作目录(C:\Program Files (x86)"的子文件夹),所以它在 Windows 7 下不能完全运行. 如果我使用任务管理器打开 UAC 虚拟化,它会很好地保存其配置,但当然无法加载该配置.

我不想将它设置为以管理员身份运行,因为它不需要这些权限.我想将其设置为在启用 UAC 虚拟化的情况下运行.

发现了一个建议我在HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags的注册表中添加了一些魔法.为了完整起见,我也把它放在 Wow6432Node 中,但都没有任何效果.

解决方案

文件系统在某些场景下是虚拟化的,那么您的问题是当您的应用程序不符合条件时如何仍然打开它?不太可能,MSDN:><块引用>

在以下情况下无法选择虚拟化:

  • 虚拟化不适用于提升并使用完整管理访问令牌运行的应用程序.

  • 虚拟化仅支持 32 位应用程序.非提升的 64 位应用程序仅在它们出现时收到拒绝访问消息尝试获取 Windows 对象的句柄(唯一标识符).本机 Windows 64 位应用程序需要与UAC 并将数据写入正确的位置.

  • 如果应用程序包含具有请求执行级别的应用程序清单,则该应用程序的虚拟化将被禁用属性.

I've seen several questions that are the opposite of this; "How do I disable virtualization?" That is not my question. I want to force an application to run with virtualization enabled.

I have an application that ran just fine under Windows XP, but, because it writes its configuration to its working directory (a subfolder of "C:\Program Files (x86)"), it does not work completely under Windows 7. If I use task manager to turn on UAC Virtualization, it saves its config just fine, but of course it then can't load that config.

I do not want to set it to run as administrator, as it does not need those privileges. I want to set it to run with UAC Virtualization enabled.

I found a suggestion that I put some magic in the registry at HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags. For completeness I also put it in Wow6432Node, but neither had any effect.

解决方案

File system is virtualized in certain scenarios, so is your question how to still turn it on when your application does not qualify? It is unlikely possible, MSDN:

Virtualization is not in option in the following scenarios:

  • Virtualization does not apply to applications that are elevated and run with a full administrative access token.

  • Virtualization supports only 32-bit applications. Non-elevated 64-bit applications simply receive an access denied message when they attempt to acquire a handle (a unique identifier) to a Windows object. Native Windows 64-bit applications are required to be compatible with UAC and to write data into the correct locations.

  • Virtualization is disabled for an application if the application includes an application manifest with a requested execution level attribute.

这篇关于强制现有应用程序始终使用 UAC 虚拟化运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆