Good day.
I wrote a console application in C # that simply downloads a file from a resource to the folder specified in the config.
It turned out an interesting situation - I run (from Visual Studio) F5 (in debugging) - everything works fine, as expected. But if I launch via Ctrl + F5 - it writes "the указанный путь был использован при запуске cmd.exe в качестве текущей папки. cmd не поддерживает пути UNC ..." after which the program crashes, because It tries to read the configuration file NOT from the program directory but from the Windows folder.

I set the task through the Task Director , who runs the program once every 1 hour, and he starts it - but this error crashes and the program crashes.
It is interesting that if you simply launch a program through an exe-file, everything works fine.
Tell me how to make the program run through the scheduler normally?
Sincerely, L.