Reputation: 29
I make an application and make setup file using VS setup project. This work fine and create default text files into Program Files Folder for winodw 7/vista .but can not modify these files or create any new files.
There are few text files need to create ,modify during application running ,but in windows 7/vista unable to create,modify files.I am using full default admin right for these OS. If iuse C: root path then application work fine or for win XP no problem.
I think UAC restricting to perform these opeartion. But i do not know how to change these restriction using vb.net, whenever application start.
I found one solution that , if change user rights manually then this problem solved. Follow these step to change your account settings. Control Panel-->User Accounts and Family Safety-->User Accounts-->Change User Account Control settings-->Never notify(Set tab to never notify). After this change need to restart system. Now can make all changes like windows XP into Windows 7.can also make changes into program files.
Its working fine, but need to make these changes manually in OS.
but its not efficent solution.
So if any one knows how can make these changes by coding that will nice.
Upvotes: 0
Views: 9352
Reputation: 593
I seriously doubt whether you can create and delete files under Program Files Folder through code in windows7/vista. Even if there is a way, I would consider doing this a bad design and a security flaw.
If you want to create/modify/delete files during you app execution. you can create them "C:\Users\\AppData\Local\\ and do whatever you want to do over there.
Program Files Folder is not the place for storing temporary data.
Upvotes: 2