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

  • Thread starter Christian Blackburn
  • 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
 
C

Christian Blackburn

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
 
A

Arne Vajhøj

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
 

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