UdiRaz
asked on
Problem modifying .ini file in c:\programdata
Hi Everyone
I'm developing an MFC Application which runs on Vista OS. I'm creating a folder under
c:\programdata , transferring .ini files (which were part of my installation exe, created using
setup factory 7) and trying to modify them at runtime, but it does not work. I'm running as invoker.
Any idea what the problem could be?
Thanks
I'm developing an MFC Application which runs on Vista OS. I'm creating a folder under
c:\programdata , transferring .ini files (which were part of my installation exe, created using
setup factory 7) and trying to modify them at runtime, but it does not work. I'm running as invoker.
Any idea what the problem could be?
Thanks
This should be because Programdata folder has a 'hiddden' attribute by default, so Your software may not see it. Try to unset the hidden attribute!
ASKER
Thanks. Is there a way to this using code ? ( since I can't modify my customers computers).
Well, how are you trying to access/modify these files? And, if you are using 'WritePrivateProfileString ()' or similar functions, what does 'GetLastError()' say when they fail (i.e. return FALSE)?
ASKER
I'm using WritePrivateProfileString, but I did not check GetLastError.
I'll check and let you know
I'll check and let you know
ASKER
The error I got was 5L "Access is Denied!"
Are the accounts that you are using to install and to run your app the same? And: In case you are copying the .ini files from a CD or DVD, they'll retain the 'read-only' attribute. I'd check that also. You can then remove that attribute using 'SetFileAttributes()'
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.