Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How can i change the vb.net ( Window Based Application ) application start up path?
Posted

1 solution

(Startup folder in Windows is actually a Start menu folder, from where Windows starts applications after logon - but I am pretty sure you haven't meant this one...)

The meaning of startup path is: the path from where the application is started - and not the path of the executable itself. When you start the application from command prompt it is the current path.

Ok, now le't try to get behind the ninsensic aspect of the question - you can't change this (except of moving the file itself), you either start from one path or another. But you can influence working directory.

1) You can change application working directory: https://msdn.microsoft.com/en-us/library/system.io.directory.setcurrentdirectory(v=vs.110).aspx[^]

2) If you start the app from code, you can specify working directry: https://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.workingdirectory%28v=vs.110%29.aspx[^]

3) Shortcuts/Shell links (.lnk) have a property that is translated startup directory, but that is also the initial worikg directory. You can use this one for example (also from VB.NET): Creating and Resolving shell links[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900