When I call ShellExecuteEx and set the Directory parameter to a path shouldn't the new process's current directory be set to that path? I am not seeing that happen unless I set the current directory of my process to that directory then call ShellExecuteEx. The apparently the new process inherites the current directory of my process and it works. Any thoughts? Jim -- www.mustangpeak.net
Jim wrote: > When I call ShellExecuteEx and set the Directory parameter to a path > shouldn't the new process's current directory be set to that path? Yes, and it works fine for me. For example, the following code opens a new instance of Notepad with the current directory set to "C:\": SHELLEXECUTEINFO info = {sizeof(info)}; info.lpFile = _T("notepad.exe"); info.lpDirectory = _T("c:\\"); info.nShow = SW_SHOW; ShellExecuteEx(&info); Do you have a specific example of something that's not working for you? -- Jim Barry, Microsoft MVP
Jim Barry wrote: > Jim wrote: > > When I call ShellExecuteEx and set the Directory parameter to a path > > shouldn't the new process's current directory be set to that path? > > Yes, and it works fine for me. For example, the following code opens > a new instance of Notepad with the current directory set to "C:\": > > SHELLEXECUTEINFO info = {sizeof(info)}; > info.lpFile = _T("notepad.exe"); > info.lpDirectory = _T("c:\\"); > info.nShow = SW_SHOW; > ShellExecuteEx(&info); > > Do you have a specific example of something that's not working for > you? Sorry to waste your time Jim, I think I recieved some incorrect information. It is working for me too. Jim -- www.mustangpeak.net