Change startup dir
-
Sorry, I'm sure this is obvious... When I start my program from a shortcut in Vista the default directory becomes c:\windows\system32. How do I make the default directory the path that the .exe is actually in? Thanks
-
Sorry, I'm sure this is obvious... When I start my program from a shortcut in Vista the default directory becomes c:\windows\system32. How do I make the default directory the path that the .exe is actually in? Thanks
In XP, you can set the "Start In" directory in the shortcut itself. Can you not do this with a Vista shortcut? Of course, there are VB functions to get the App Directory from within code if this is what you are after...
I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!
-
In XP, you can set the "Start In" directory in the shortcut itself. Can you not do this with a Vista shortcut? Of course, there are VB functions to get the App Directory from within code if this is what you are after...
I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!
I don't see any way to change the "start in" value in Vista. In any case there must be a way to change the default directory programmatically.
-
In XP, you can set the "Start In" directory in the shortcut itself. Can you not do this with a Vista shortcut? Of course, there are VB functions to get the App Directory from within code if this is what you are after...
I don't have ADHD, I have ADOS... Attention Deficit oooh SHINY!! Booger Mobile (n) - A bright green 1964 Ford Falcon - our entry into the Camp Quality esCarpade!! Do something wonderful - make a donation to Camp Quality today!!
-
If I understand you correctly, the following should work:
System.IO.Directory.SetCurrentDirectory("c:\myfolderpath")
Hope that helps. -Ray
Hi Ray, Totally helps. What I really needed, which I figured out thanks to your message, was: System.IO.Directory.SetCurrentDirectory(Application.StartupPath) I knew it had to be simple!