I have a .net console application written in c# which does exactly what it should when run inside visual studio and when clicking the .exe file in the file system. It runs like
It seems like a permissions issue to me. Running the code inside VS is way too different to running it on its own. VS takes care of most of the stuff and makes life easy for the developer.
Can you please check if the account you are using to run the scheduled task has permission to access the network path?