in reply to Change Directory.
See chdir. What you are doing is changing the directory for the subshell. At the end of the system() call, the subshell exits and the current directory for your application remains unchanged.