c# - How to get installed exe file system path after scheduling in windows scheduler? -


i have written in console application line system.io.path.getfullpath("applicationsubdirectory") application directory file system path.

i build application , installed exe in system. exe has been installed in c://programfiles/appfolder/ directory. when execute exe got valid path c://programfiles/appfolder/applicationsubdirectory.

but when scheduled exe run dailly basis in windows scheduler. getting wrong path. returns me path of directory windows scheduler installed c://windows/system32/applicationsubdirectory. wrong path.

please me how valid path after scheduling exe too.

thanks lot.

this because console application started task scheduler. obtain actual path add following code application

system.io.path.getdirectoryname(system.reflection.assembly.getexecutingassembly().location); 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -