Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

StartupPath property

Status
Not open for further replies.

JScannell

Programmer
Jan 9, 2001
306
US
There is an "Application.StartupPath" property that is a part of the System.Windows.Forms. I have never heard of this before, as I have only written .net code in C#. It seems that this is only available with vb.net.

How do you change the value of that property? Obviously, the developer before me knew how to set it, but now I have to change it and I don't know where to go...

I'm using VS 2005 if that helps.

Thanks in advance,

Jerry Scannell
 
I believe this is a read only field whose output indicates which directory the exe is being run from.

If at first you don't succeed, then sky diving wasn't meant for you!
 
I noticed that it was read-only, but how does it get set to begin with?

Jerry Scannell
 

Ummm...it's the path where the executable is "physically" located on the drive. For example, if the executable is in C:\Program Files\MyApp, the the Application.StartupPath is "C:\Program Files\MyApp". It the executable is in "C:\MyApp", then the Application.StartupPath is "C:\MyApp". The value is "set" by where the application is located in the file system. to change it, move the application to a different directory.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 

I just checked and Application.StartupPath is available in C# as well as VB.



I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
You can also specify the start path in any standard shortcut or it is automatic for click once deployment. I could have sworn there was a way in code as well, but if so I can't remember it now.

-I hate Microsoft!
-Forever and always forward.
-My kingdom for a edit button!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top