Windows 7 - Can't update my program's files in C:\\Program Files

假装没事ソ 提交于 2019-12-01 12:22:50

You could also embed a manifest in your EXE that makes your program require adminrights on Windows 7 / Vista.

On Windows Vista, UAC means that users run without admin rights and don't have write access to the program files directories.

The correct solution is to write to a folder for which standard users do have write permissions.

The solution you are looking for is to make your app's folder within program files writeable to all users. You can do this by adding a DACL when installing. It is extremely bad practice to allow standard users to write inside the program files directory and I urge you instead to re-code your app so that it does not need to write there.

Assuming you're doing this as part of modifying the config (and not when your application is running for regular users)...

Your user account probably doesn't have the correct permissions to write/modify the file. Assuming your account is an administrator account, right-click the file, select "Properties". Click the "Security" tab. Click edit and give your user account Full Control.

If you can't do this, it's probably because the ownership of the file doesn't allow you. If this is the case, click on "Advanced", go to the "Owner" tab, and click "Edit".

However, if it needs these permissions when it's running, you should instead be using the %AppData% folder.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!