Drew,
I don't have wmic.exe loaded and I am not interested in using it. You did not mention if the error is happening with wmic or outlook.
Run Program() executes the external executable and runs the commands (options). I expect control never returned to JMP because there were no commands to return control to the program when Outlook was executed. I suggest you use Open() just in case. As stated I have not used wmic.exe; does it run one command and end, or does it keep the session open? This could also cause Run Program to never return control to JMP.
Anyway, below is a script using tasklist.exe.
Also, just in case others would like to use this script, I included the code to find the path of Outlook.exe using where.exe. I also have 32 bit Outlook but my path was different than yours. Note, there is a 3 second wait that displays the outlookpath. That caption code can be removed.
Names Default To Here( 1 ); // Make sure variables are stored in this procedure
Clear Log(); // Clear the JMP Log - Select View - Log
//find outlook
outlookpath = "";
cmd1 = "\[/c where /R "C:\Program Files (x86)" OUTLOOK.EXE]\";
rp0 = RunProgram(Executable("CMD.EXE" ),
Options({Eval(cmd1)}),
Read Function("text")
);
outval = words(Trim(rp0), "\!n");
if(StartsWith(outval[1], "C:\Program Files"), outlookpath=outval[1]);
//only run this if not found
if (outlookpath =="", //try for 64 bit version of excel
cmd1 = "\[/c where /R "C:\Program Files" OUTLOOK.EXE]\";
rp0 = RunProgram(Executable("CMD.EXE" ),
Options({Eval(cmd1)}),
Read Function("text")
);
outval = words(Trim(rp0), "\!n");
if(StartsWith(outval[1], "C:\Program Files"), outlookpath=outval[1] );
);
if(outlookpath =="", Caption("Cannot find Excel ... aborting"),
Caption( "Outlook path is: "|| outlookpath) );
wait(3);
caption(remove);
//_____________________________________________________________________________
windowsProcesses = RunProgram(executable("CMD.exe"),options({"/c tasklist /FI \!"IMAGENAME eq outlook.exe\!""}),
readfunction("text")
);
/* to get a list of all processes just use /c tasklist */
show(windowsProcesses);
//
// Check if outlook is open by searching the log file
openYesNo = If(contains(lowercase(Trim(windowsProcesses)),"outlook"),1,0);
// Open Outlook if it is currently closed
If( openYesNo == 0,
Open(outlookpath)
);