-
Local folder problem
I programming in c++ and I need help.
I made one program that should run other program, but i got one problem
Program unable to run program if it running directly from other folder.
t.ex.
program located in folder
c:\windows\progs\myprog.exe
I starting it in command line from root C:\
and program showing that path not found
but when i opening c:\windows\progs\ and then running program, so it works.
....
how can I make program to find folder that it was running from. (programs local folder and run other program from this folder)
-
2 ideas:
a) add called program' path to PATH
b) call "called program" using absolute path (full path). Windows is good but isnt magic; it cant find a program in you disk if you dont give it some tips :)
-
How can I make my program to identify what folder it was runing from?
-
I using stdlib.h and system() to run other programs, but do some one know some other way to do it?
-
CreateProcess
to start one, also other process API's are on this site,
and GetCwd to get the current working directory.
hope this helps ;)