Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The StartInfo filename is actually the full path to the executable</p> <p>For example, on a wrapper I have for x264, it looks like this:</p> <pre><code>x264Start.FileName = Directory.GetCurrentDirectory() + @"\Tools\x264\x264x86-r1995.exe"; </code></pre> <p>I'd sense-check the code by adding a try {}, catch {} in there and writing the actual filename you are trying to call into the debug if you have an error.</p> <p>Otherwise add something like the below:</p> <pre><code> if (File.exists(sign.FileName)) { sign.Start(); } else { Console.WriteLine("Can't find {0}", sign.FileName); throw new Exception("File doesn't exist"); } </code></pre> <p>EDIT: Added a full example - this searches for CCleaner and then runs it with the "/AUTO" switch. Just tested and works fine.</p> <pre><code> // detect if 64-bit system string programFiles = ""; if (Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE").Contains("64")) { Console.WriteLine("#info# x64 detected"); programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); } else { Console.WriteLine("#info# x86 detected"); programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86); } // search string[] dirs = Directory.GetDirectories(programFiles, "CCleaner", SearchOption.AllDirectories); string[] exes = Directory.GetFiles(programFiles, "CCleaner64.exe", SearchOption.AllDirectories); //debug only foreach (string s in dirs) { Console.WriteLine(s); } foreach (string s in exes) { Console.WriteLine(s); } // access directly ProcessStartInfo CCleaner = new ProcessStartInfo(exes[0], "/AUTO"); Process.Start(CCleaner); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload