When I am running
myProcess = Process.Start("something.exe")
and want to start it using button it doen not find the file - i need to execute it from the same folder where application is how can i do that? Thank you.
System could not fin开发者_运维技巧d this file - but it is there . in the same folder as application.
Using Visual Basic 2008 Express
When I add there this:
System.Diagnostics.Process.Start(System.IO.Path.Combine(My.Application.Info.DirectoryPath, "something.exe"))
It is working thanks for help - FIXED :-)
You should try something like
Process.Start(System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "notepad.exe"))
When running from VS the folder with your application is the bin/Debug or bin/Release. The program should be there.
Another option is to add the path to the program extracted from Assembly.GetExecutingAssembly().GetName().CodeBase
精彩评论