Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing to files on system drive C: without admin rights in Delphi

I am trying to write Memo text to a .txt file in Delphi XE3, in Windows 8, but for some reason when I run the program in the IDE it works (the temp .exe is on my D: drive) but when I copy my program to C:\Myprogram.exe it gives error "Access denied" so i cant write anywhere on C:\

I already tried making a manifest and that did not work.

P.S.: I don't want to run my program as an administrator and when I do run as admin it works.

like image 668
Kobus Vdwalt Avatar asked Dec 23 '12 18:12

Kobus Vdwalt


1 Answers

If you're not an administrator, you cannot write in certain places. That is to protect you (or your users) and it's a rule you cannot circumvent without disabling UAC, which you should't rely on (if it's possible at all in Windows 8).

Pick a location you can write to, for instance a Documents folder or another special folder for storing application data.

like image 86
GolezTrol Avatar answered Nov 15 '22 02:11

GolezTrol