View Single Post
Old 04-01-2015, 03:48 PM
passel's Avatar
passel passel is offline
Sinecure Expert

Super Moderator
* Guru *
Join Date: Jun 2003
Location: Upstate New York, usa
Posts: 8,031

That is a temporary path, which is where the code is running, not where it is permanently located.
See if you can use the path to where the assembly is permanently located instead.
Dim fullpath as String = System.Reflection.Assembly.GetExecutingAssembly().CodeBase

edit: I just tried it. The CodeBase returns a URL, so you have to modify it.
Perhaps there is a method to do it, but I just manually did it.
    Dim fullpath As String = System.Reflection.Assembly.GetExecutingAssembly().CodeBase
    fullpath = fullpath.Replace("file:///", "")
    fullpath = fullpath.Replace("/"c, "\"c)
    Dim ThisDir As String = My.Computer.FileSystem.GetParentPath(fullpath)
There Is An Island Of Opportunity In The Middle of Every Difficulty.
Miss That, Though, And You're Pretty Much Doomed.

Last edited by passel; 04-01-2015 at 03:59 PM.
Reply With Quote