Unscruffed
Programmer
Hi everyone. Got a little problem and hope you can help.
This is an example of what I'm trying to do:
I run a file called Test1.exe on my c drive.
Test1.exe then calls Test2.exe in folder c:\testapp.
So we have:
c:\Test1.exe calls c:\testapp\Test2.exe
When Test1.exe runs, CurDir$ = c:
The problem is that when Test1.exe calls Test2.exe, CurDir$ in Test2.exe also = c: and not c:\testapp. This occurs using both Shell and Run commands.
My question is, how can Test2.exe find itself? ie: same as VB's App.Path function?
It's possible to solve this by changing directory first, or sending the path in the command line, but only my own apps will know that this is required. Therefore, this solution is not an option as it will not solve the problem if Test2.exe is called from a 3rd party app, or, Test2.exe is run direct from the Dos prompt outside it's own directory.
Any help appreciated.
Be good. If you can't, don't get caught!
This is an example of what I'm trying to do:
I run a file called Test1.exe on my c drive.
Test1.exe then calls Test2.exe in folder c:\testapp.
So we have:
c:\Test1.exe calls c:\testapp\Test2.exe
When Test1.exe runs, CurDir$ = c:
The problem is that when Test1.exe calls Test2.exe, CurDir$ in Test2.exe also = c: and not c:\testapp. This occurs using both Shell and Run commands.
My question is, how can Test2.exe find itself? ie: same as VB's App.Path function?
It's possible to solve this by changing directory first, or sending the path in the command line, but only my own apps will know that this is required. Therefore, this solution is not an option as it will not solve the problem if Test2.exe is called from a 3rd party app, or, Test2.exe is run direct from the Dos prompt outside it's own directory.
Any help appreciated.
Be good. If you can't, don't get caught!