c# - program searching wrong directory for config file when run from task scheduler -
i have c# form application. opens text file upon loading. text file reads default settings. fills numericupdown fields , textbox fields default data.
i want run every night @ specific time. windows task seems trying open program. however, upon loading gets filenotfoundexception not find file 'c:\windows\system32\settings.txt close application run folder. opens when running command line , using run in mvs2013.
in program searching file using relative pathing
could shed light on ridiculousness? appreciate it.
your path relative working directory, seems "c:\windows\system32" if didn't specify any. possible solutions are, set working directory directory of executable file (the "start in (optional)" field) :

.. or modify program use absolute path of executable (you can absolute path programmatically).
Comments
Post a Comment