I have a task that runs a .exe , It is a simple VB program that reads from a txt file, in the code I have this:
My.Computer.FileSystem.OpenTextFileReader("test.txt")
But when the scheduler runs the .exe , it throws a FileNotFound exception because it is searching in "C:\Windows\system32\test.txt".
I tried writing the path as ".\test.txt" I need the file to be in the same directory than the .exe.
How can I fix this? Is this a windows-7 task scheduler problem?
Note: when I run the program manually it doesn't throws the exception. update: the path must be like that because im going to deploy the .exe in other computers with other paths