I’m doing an application(XE6 , Firemonkey) to synchronize files between a shared folder and a computer/s. This application checks every x hours if there are new files to be synchronized, and it starts on windows start-up.
I can do everything, my application starts on start-up, and it does the synchronization, as long as i’m the one starting it. Whem the application auto starts on start up it gives me an exception “EINOUTERROR” – File Access Denied.
On starting the application reads a small .txt file to set up it self (shared folder location, rate of synchronization etc), my guess is that since its the windows starting the app runs it without privileges to read the .txt, but even after changing the .txt permissions to full control on everyone it gives the same error.
File open code:
if FileExists(‘Dados.txt’) then
FileMode := fmOpenRead;
Code of placing the app on startup programs :
procedure TSyncM.RunOnStartup(const sCmdLine: string; bRunOnce: boolean; Remove: Boolean) ;
var sKey: string;
const ApplicationTitle = ‘GEN4Sync’;
if (bRunOnce) then
sKey := ‘Once’
sKey := ”;
Section := ‘Software\Microsoft\Windows\CurrentVersion\Run’ + sKey + #0;
with TRegIniFile.Create(”) do
RootKey := HKEY_CURRENT_USER;
if Remove then
WriteString(Section, ApplicationTitle, sCmdLine) ;
If i comment the piece of code that calls the reading of that .txt my app starts and executes well, but i don’t want to set it up everytime.
Thanks in advance