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) :

enter image description here

.. or modify program use absolute path of executable (you can absolute path programmatically).


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -