Run app with windows starup error. lazarus / 12-Debugger ---------------------------------------------------------------------- nocuttree · 2014-10-13 06:42 Hello all! I have run an app with windows starup, it has showed a message error "File not found" (My app work with a text file) but no error when I run app manual by mouse click. Thanks all! ---------------------------------------------------------------------- CM630 · 2014-10-13 07:23 I would recommend you not to use the debugger section of the forum for all your threads, especially for those, which are not related to the debugger. Posting some of your code would be useful, I would say it's must. May the reason for the "File not found" error is that you are not supplying the full path to it. When you run the app by a mouse click, it probably searches the file in its own directory, while the properties of the shortcut in your start menu do not point to the same folder. ---------------------------------------------------------------------- nocuttree · 2014-10-13 11:26 Quote from: paskal on October 13, 2014, 09:23:55 amI would recommend you not to use the debugger section of the forum for all your threads, especially for those, which are not related to the debugger. Posting some of your code would be useful, I would say it's must. May the reason for the "File not found" error is that you are not supplying the full path to it. When you run the app by a mouse click, it probably searches the file in its own directory, while the properties of the shortcut in your start menu do not point to the same folder. I am sorry! but i can't know where to post my threads  How can I remove my threats? My code is very simple. Code: [Select]assignfile(st, 'settings'); ---------------------------------------------------------------------- minesadorada · 2014-10-13 12:18 Quote from: nocuttree on October 13, 2014, 01:26:32 pm My code is very simple. Code: [Select]assignfile(st, 'settings');           Is this code in a Form.Create() of your main form?  If so, move it to Form.Show() If it is a console app, it could be that your app is starting up before Windows is 'ready' to read/write the file. Putting the code in a Try..Except block and running in debugging mode may help to find the problem. No other insights, I'm afraid.. ---------------------------------------------------------------------- User137 · 2014-10-13 16:12 Right click on the shortcut that launches your app, open properties and set its working directory to location of the executable. ---------------------------------------------------------------------- CM630 · 2014-10-14 06:54 Quote from: nocuttree on October 13, 2014, 01:26:32 pmI am sorry! but i can't know where to post my threads    So if you cannot determine the right section for your post, use General. Better positioning of the section is likely to provide a faster answer.  Quote from: nocuttree on October 13, 2014, 01:26:32 pm How can I remove my threats?   AFAIK, you can delete it, but only moderators and admins can move it.  Quote from: nocuttree on October 13, 2014, 01:26:32 pm My code is very simple. Code: [Select]assignfile(st, 'settings');           And still that is not all your code. What is the value of st? You should use the full file path for the st variable (i.e. c:\myfile\alabala.txt). You might experience some troubles when using non-basic Latin characters. In that case assignfile(utf8tosys(st), 'settings'); might solve your problem. ---------------------------------------------------------------------- nocuttree · 2014-10-14 12:39 Quote from: paskal on October 14, 2014, 08:54:40 amQuote from: nocuttree on October 13, 2014, 01:26:32 pmI am sorry! but i can't know where to post my threads    So if you cannot determine the right section for your post, use General. Better positioning of the section is likely to provide a faster answer.  Quote from: nocuttree on October 13, 2014, 01:26:32 pm How can I remove my threats?   AFAIK, you can delete it, but only moderators and admins can move it.  Quote from: nocuttree on October 13, 2014, 01:26:32 pm My code is very simple. Code: [Select]assignfile(st, 'settings');           And still that is not all your code. What is the value of st? You should use the full file path for the st variable (i.e. c:\myfile\alabala.txt). You might experience some troubles when using non-basic Latin characters. In that case assignfile(utf8tosys(st), 'settings'); might solve your problem. Quote from: User137 on October 13, 2014, 06:12:20 pmRight click on the shortcut that launches your app, open properties and set its working directory to location of the executable. Quote from: minesadorada on October 13, 2014, 02:18:04 pmQuote from: nocuttree on October 13, 2014, 01:26:32 pm My code is very simple. Code: [Select]assignfile(st, 'settings');           Is this code in a Form.Create() of your main form?  If so, move it to Form.Show() If it is a console app, it could be that your app is starting up before Windows is 'ready' to read/write the file. Putting the code in a Try..Except block and running in debugging mode may help to find the problem. No other insights, I'm afraid.. Thanks you very much!