Application Working Path
Hello all,
I want to launch an application, which is quite easy: Process.Start("myfolder\\myapp.exe");
but, I can't find the way to set the working directory of the application I launch (since it should be myfolder).
Any ideas?
Thanks!
# 1 Re: Application Working Path
System.Reflection.Assembly.GetExecutingAssembly.Location will return the full path and the name of the executing assembly.
Edit
And the easiet one is System.AppDomain.CurrentDomain.BaseDirectory()
# 3 Re: Application Working Path
But, how can I set the working directory of the application that I launch?
Oh, I misread your first post. You need to StartInfo to set the Working Directory like this Process pTemp = new Process();
pTemp.StartInfo.WorkingDirectory = @"C:\Temp";
pTemp.StartInfo.FileName = "notepad.exe";
pTemp.Start();