0

I have the following problem. When my application is installed and runs the first time it needs to create a text file in C:\ but when i do my application gets an error that it does not have the appropriate rights. When starting it as admin i do have the rights and do not get the error.

Some applications like dropbox ect do not have this problem. When it is not run as admin it just gives you the popup asking for permission to execute the command. When you give it permission it works fine.

Is there any way i can also bring this windows popup up so that my application does not have this problem?

The application auto-starts on startup so i cannot set it to run as admin because then windows does not allow it to start automatically.

Marcel
  • 874
  • 1
  • 14
  • 28
  • 3
    The real problem is that you're writing to the system drive root. No one except system should write there. – TLama Aug 04 '14 at 10:12
  • @Tlama my software directory is in C:\application name\ should i rather put the file there? will i still need admin rights to create and edit the file? – Marcel Aug 04 '14 at 10:21
  • 1
    Use application data folder. That is the folder where applications should store their data. Read about it e.g. in [`this article`](http://blogs.msdn.com/b/patricka/archive/2010/03/18/where-should-i-store-my-data-and-configuration-files-if-i-target-multiple-os-versions.aspx). – TLama Aug 04 '14 at 10:25
  • 1
    @TLama Thank you that did seem to sort out my problem. – Marcel Aug 04 '14 at 11:38

0 Answers0