Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Can I run two commands simultaneously?

I have a deployment package that runs one PowerShell command and one CMD command.  The commands are independent of each other and I want to know if I can run the second command while the first command is still running.

The PS command can take 2 - 30 minutes to run and the CMD command opens up a program to monitor the PS command while it's running.  Currently, the monitoring program doesn't open up until the PS command is done, which doesn't help.  The CMD command also doesn't stop "running" until I close the monitoring program which I'd rather not have happen either.

What I'd prefer is to:

  1. Run the CMD command to open the program I need open.
  2. Once the command executes, Step 1 should be considered completed successfully, even though the program window is still open.
  3. Step 2 (PS) should then execute to actually start the process going.
  4. The Deployment will be considered complete once the PS command is finished running.

Can that be done?



Date Votes
  • kelemvor,

    I think you could do this all in one CMD step with something like this:

    start powershellscriptmonitorthingy.exe -bla -bla -bla
    powershell.exe "C:\path\to\script.ps1"

  • Thanks.  I was actually able to get it working by using that Start command.

    I did:

    Step 1: Start blahblah.exe
    Step 2: Powershell command

    Seems to work perfectly.