Skip to content

Instantly share code, notes, and snippets.

@huduntech
Last active March 3, 2016 03:03
Show Gist options
  • Save huduntech/9bde433073462b0fa328 to your computer and use it in GitHub Desktop.
Save huduntech/9bde433073462b0fa328 to your computer and use it in GitHub Desktop.
Windows用户权限管理

需要管理员权限的操作

Tasks that trigger a UAC prompt

  • Running an Application as an Administrator
  • Changes to system-wide settings or to files in %SystemRoot% or %ProgramFiles% (注意,写%ProgramFiles%,非常常见的操作,很多人的编码习惯是将配置文件直接写在根目录,而程序安装时一般是在%ProgramFiles%目录,若没处理好权限问题,会出现不可写的情况)
  • Installing and uninstalling applications
  • Installing device drivers
  • Installing ActiveX controls
  • Changing settings for Windows Firewall
  • Changing UAC settings
  • Configuring Windows Update
  • Adding or removing user accounts
  • Changing a user’s account type
  • Configuring Parental Controls
  • Running Task Scheduler
  • Restoring backed-up system files
  • Viewing or changing another user’s folders and files
  • Running Disk Defragmenter
  • Running Registry Editor (注意,修改注册表,常见操作)
  • Running the Windows Experience Index assessment

参考 Wikipedia UAC控制

常见的解决方案

尽量避开需要管理员权限的操作

比如,将缓存、配置文件写到%APPDATA%或%TEMP%,而不是%ProgramFiles%或注册表

windows无须管理员权限可写目录

直接申请管理员权限

一般不推荐使用,除非软件一定要修改某些系统设置。尤其是每次软件启动都申请管理员权限的行为,很影响用户体验。

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment