views:

14

answers:

1

I wanted to make mysql dump files using a batch file and an app made through visual studio 2008. How can I incorporate this batch file or call it from vb? There is a code like this in vb.net but its using an absolute address:

Process.Start("C:exe\execute.exe")

How do I modify this so that I could just execute the file without providing the exact address. Or is there any place in the file system(windows 7) where I could just copy the exe file and just call it this way?

Process.Start("execute.exe")
A: 
  • You could copy execute.exe somewhere that's within your PATH environment variable.
  • Your .net code could use System.IO.Directory.SetCurrentDirectory to change the working directory at run time
  • You could right click on a shortcut to your .net script and set the "Run in" box to somewhere where your execute.exe is.
  • You could ship the two together so that they'll always be in the same directory.
altie