How do I return the working directory used on my application from ashortcut

  • Thread starter Thread starter Christian Blackburn
  • Start date Start date
C

Christian Blackburn

Hi Gang,

One of the properties of a shortcut is the working directory. I would
like to be able to detect and use whatever working directory the
shortcut specified. Can someone tell me how to find that out?

Thanks a Zillion,
Christian
 
Hi Gang,

Well nobody seemed to know this one and I found the answer myself. I
hope this proves useful for someone?

//Stores the path to the working directory
string strWorking_Directory;

//Detects the path to the working directory
strWorking_Directory = System.IO.Directory.GetCurrentDirectory();

Cheers,
Christian
 
Christian said:
Well nobody seemed to know this one

You only waited two and a half hour (while night in the US
and very early Sunday morning in Europe).
//Stores the path to the working directory
string strWorking_Directory;

//Detects the path to the working directory
strWorking_Directory = System.IO.Directory.GetCurrentDirectory();

Strictly speaking current directory is not the same as the
working directory in the short cut. It will be when the app
startup, but the app could change current directory after that.

Arne
 
Back
Top