change calling directory

  • Thread starter Thread starter funkforce
  • Start date Start date
F

funkforce

Hi
I would like to change the calling directory of my console c#
application to sometgin else.

For example calling myapp like this:

C:\temp\myapp.exe

I want myapp to execute and then exit but it should exit in another
directory for exampel in c:\windows.

How can this be done?

Regard
Ralf
 
Hi,

I don't think you can do that. When a process is started it recveives its
own copy of the evirnoment. The process can modify that copy (e.g.
Evironment.CurrentDirectory) but it won't affect the other prcesses running
in the system(in your case the command prompt process used to start the
program).
 
Back
Top