I've written a program in environment DELPHI 7. This file is inserted in a launcher that I've sent to my client; he has installed then the file.exe on its computer (SO: VISTA/7).
My procedure works leaning to a simple text.file, but it must be before created at root (usually, "C:\").
The host SO prevent my file.exe to create the text.file to work, with the error message "Unable to write c:\File.Txt".
This problem probably derives by the system of writing permissions in the host SO, but by choice, the client don't must modify this system manually for me.
How can I bypass the Windows protection?
- don't write on C: and where?;
- create a new sub-folder free of limit: in which folder?;
- vary one key in HKLM: which?;
- install a .bat file: and it have permissions?;
My installer creates an icon on the desktop to launch the .exe file: in the .pif file, can I insert switches to ask SO that the permissions the .exe file to create/write files on the disk?
I've read many posts, but no contains solution for my problem.
I hope I was clear.

4 Years
Discussion Span
Last Post by Reverend Jim

You could use the values of the environment variables HOMEDRIVE and HOMEPATH to get the location of the user's home directory then create the file in a folder under that, perhaps in "Documents"

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.