Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That only might start system wide extensions like <code>.bat</code> or even <code>.txt</code>, but it can't always launch correct programs through extensions.</p> <p>Instead try this API or a similar alternative in <a href="http://en.wikipedia.org/wiki/.NET_Framework" rel="nofollow noreferrer">.NET</a>:</p> <blockquote> <p>FindExecutable : <em>shell32.dll</em> Alias : <em>"FindExecutableA"</em> / <em>"FindExecutableW"</em> return type : <em>int</em> parameters : <strong>·</strong> <em>lpFile</em> Pointer to a null-terminated string specifying a filename. This can be a document or executable file. <strong>·</strong> <em>lpDirectory</em> Pointer to a null-terminated string specifying the default directory. <strong>·</strong> <em>lpResult</em> Pointer to a buffer to receive the filename when the function returns. This filename is a null-terminated string specifying the executable file started when an “open” association is run on the file specified in the lpFile parameter.</p> </blockquote> <p>This returns an integer bigger than zero if success and the char value will contain a <a href="http://en.wikipedia.org/wiki/Null-terminated_string" rel="nofollow noreferrer">null-terminated string</a> that points to the executable that launches this file extension then you can use it like this</p> <pre><code>System.Diagnostics.Process.Start ("program.exe $:\path\x.abc"); </code></pre> <p>Instead of <code>program.exe</code>, you'll use the result of the API function, and you'll use the path to the file separated with a space just like a command line.</p> <p>As for the application failure, it might indicate that the program needs administrative rights to run correctly. <code>cmd</code> already got administrative rights, so it can make child applications inherit it, but not windows API. <code>createprocess</code> allows you to use <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/aa379560%28v=vs.85%29.aspx" rel="nofollow noreferrer">LPSECURITY</a> attributes which can help in launching this program with the correct privileges.</p>
    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. 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