tags:

views:

181

answers:

2

paths are relative to current directory. I've tried tens of combinations of quoting, not quoting, changing to parent directory and removing the .., but I always get a FileNotFound error.

bridge_process = System.Diagnostics.Process.Start(
    @"../Tools/RunHidden",
    @"../My-Bridge.bat");
+1  A: 

Instead of passing a relative directory, why not pass a fully-qualified path? You can use the static methods on the Path class in the System.IO namespace to help you create the path.

casperOne
+1  A: 

"Current directory" can in some cases be c:\windows\system32 in my experience.

Try this:

    string fullapppath = Assembly.GetExecutingAssembly().Location;
    string apppath = System.IO.Path.GetDirectoryName(fullapppath);

    string path1 = System.IO.Path.Combine(apppath, @"../Tools/RunHidden");
    string path2 = System.IO.Path.Combine(apppath, @"../My-Bridge.bat");

    bridge_process = System.Diagnostics.Process.Start(path1, path2);
Wolf5