On Windows you can use the [winim](https://github.com/khchen/winim) package, 
specifically `winim/com`, for this purpose.

Exemple: 
    
    
    import winim/com
    
    const cmd = "cmd.exe /c ping 127.0.0.1"
    
    comScript:
      var a = CreateObject("WScript.Shell")
      
      echo "Executing command, waiting to finish and showing the window..."
      discard call(a, "Run", toVariant(cmd), toVariant(1), toVariant(true))
      
      echo "Executing command, waiting to finish and not showing the window..."
      discard call(a, "Run", toVariant(cmd), toVariant(0), toVariant(true))
      
      echo "Executing command, without waiting to finish and showing the 
window..."
      discard call(a, "Run", toVariant(cmd), toVariant(1), toVariant(false))
      
      echo "Executing command, without waiting to finish and not showing the 
window..."
      discard call(a, "Run", toVariant(cmd), toVariant(0), toVariant(false))
    
    
    Run

Reply via email to