views:

35

answers:

3

Hello,

My program uses some external programs that i included in the Files folder.

In my code im reffering to Files/external_program.exe Windows Vista & Windows 7 knows how to handle this and starts the program on the same location as my program in the Files folder.

But Xp doesnt know where it is, and Windows XP will think im reffering to the C:\Files folder. So im getting an error and the app crashes.

How can i fix this? so windows xp will know that i'm reffering to the Files folder on the same location as my program.

+2  A: 

Check out application.startuppath

http://msdn.microsoft.com/en-us/library/system.windows.forms.application.startuppath.aspx

dim progdir as string=application.startuppath & "\files\externalexe.exe"
Stefan
works perfect Thanks.
PandaNL
A: 

Please add application.path before the path of the location.

Untopronor
+1  A: 

Path.Combine(Environment.CurrentDirectory, "Files\external_program.exe")

Bobby
Thanks will try this out when i get home.
PandaNL