?
Solved

Problem modifying .ini file in c:\programdata

Posted on 2009-04-30
7
Medium Priority
?
882 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:UdiRaz
  • 4
  • 2
7 Comments
 
LVL 3

Expert Comment

by:Bigboj
ID: 24268014
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!
0
 

Author Comment

by:UdiRaz
ID: 24268041
Thanks. Is there a way to this using code ? ( since I can't modify my customers computers).
0
 
LVL 86

Expert Comment

by:jkr
ID: 24270669
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)?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:UdiRaz
ID: 24288887
I'm using WritePrivateProfileString, but I did not check GetLastError.
I'll check and let you know
0
 

Author Comment

by:UdiRaz
ID: 24289544
The error I got was 5L "Access is Denied!"
0
 
LVL 86

Expert Comment

by:jkr
ID: 24290601
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()'
0
 

Accepted Solution

by:
UdiRaz earned 0 total points
ID: 24292734
I'm using an option to keep original file attributes so the files are not read only,
however, I found an alternative solution which is to save to c:\users\public
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question