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

这一生的挚爱 提交于 2019-12-19 11:24:26

问题


I have an addin program that works with MS Word (version 2007). It is located in the C:\Program Files location. I installed Windows 7 and then went to make a routine change to my files in this location and it would only bring up a read only file. How can I grant myself permission to write to my own program? I cannot change this location or use any other workaround. I have this product out to 25 different companies and I can't change the programming to work from any other location. Thanks


回答1:


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




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/6281696/windows-7-cant-update-my-programs-files-in-c-program-files

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