shellExecute

Started by Carlo Didier, November 07, 2018, 03:10:39 PM

Previous topic - Next topic

Carlo Didier

Any ideas why this just won't work? I also tried with the full path to Notepad.exe.

All it does is output the content of strCommandLine, but it doesn't start Notepad.

Same with anything I tried. Just nothing happens. No errors, no other output, nothing at all.
<script>
    strCommandLine = 'notepad.exe';
    console.log(strCommandLine);
    shellExecute(strCommandLine);
</script>

Mario

shellExecute is not a built-in JavaScript command. This functionality is provided by IMatch via an endpoint.

Please refer to the sample app "Processes" which shows how to launch Windows Notepad. This app is included in IMatch.
It uses the following code:

IMatch.shellExecute({
    'verb' : 'open',
    'executable' : 'notepad.exe'
}).then(function(response) {



You need to include jQuery and the IMatchHelp wrapper class in your index.html.

See C:\ProgramData\photools.com\IMatch6\webroot\imatch\samples\process\index.html

The documentation for shellExecute is here: https://www.photools.com/dev-center/doc/imatch/IMatch.html  This page also has several examples for how to use this method.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

JohnZeman

Carlo if it helps here is a snippet from one of my apps where I run an external command script.  Note the escaped \ in the full path of the script file name.

      // CHECK MATCHING IMAGES FOR REPROCESSED JPGS CMD SCRIPT ////////////////////////////////////
      $('#btn-check').click(function() {
         IMatch.shellExecute({
            'executable': 'D:\\Mine\\cmd\\Reprocessed Photo Match for JPGs Check.cmd',
            'verb': 'open',
            'showwindow': true
         });
      });
      /////////////////////////////////////////////////////////////////////////////////////////////

Carlo Didier

Quote from: Mario on November 07, 2018, 03:16:17 PM
IMatch.shellExecute({
    'verb' : 'open',
    'executable' : 'notepad.exe'
}).then(function(response) {



That works! Thanks!