1 Reply Latest reply on Aug 29, 2014 12:15 PM by scarney

    sadmin status and console

    scarney

      All,

       

      Ideally, it would be nice if one could run 'sadmin status' and it return a code indicating whether Solidcore is enabled or not.

      Right now, I have to paw through it's output to figure that out.

       

      We are doing this in a GUI application.  Here is the scoop.

       

      I wrote a vbscript to run the command and parse it's output.  The vbscript returns 0 if all is well, 1 if application control

      is not enabled, 2 if it is not installed, some other positive number for other problems.

       

      When our gui app runs, it calls the script and displays a warning message if my script has a non-zero return code.

      The problem is that a console window pops up while my script runs.

       

      There are a couple of things:

       

      1. I did some Google'ing and found that instead of using a Shell object to run the command and get it's output on a pipe, I could instead use a Win32_Process to run the command and dump it's output to a file.  Any feedback to the user is going to a logfile instead of the screen.  No WScript.Echo or MsgBox or anything.  After some futzing, I got it all working.
      2. In our app we are using ::system in C++ to launch my script.  I read that this will cause a console to be launched.  If we don't want that, use CreateProcess.

       

      My question is does it matter?  When I double click 'sadmin.exe' from Windows Explorer, I notice a console briefly flashes.  Are these other mitigations even going to matter?

       

      My bigger question can I request a feature in which sadmin tells me it's status based on return code rather than parsing it's output?

       

      --

      Regards,

      Sandra Carney