a) Your "cd" command only lasts as long as the sub-process does (and it only affects the sub-process). If you really want to change the directory in this process, you need to use the chdir() API call.
b) You already have the directory in a string, so why not try to catenate the directory and filename, say the equivalent of:
notepad somedir\somefile.txt
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Offline 7,164 posts
since Dec 2005