change calling directory

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
 
S

Stoitcho Goutsev \(100\) [C# MVP]

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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top