Akki
Akki

Reputation: 171

Run an exe in Powershell and close the cmd promt once the exe is executed

Hi I want to execute a exe from powershell script. Which I am doing as:

[Diagnostics.Process]::Start("$Exepath")

However after the execution the cmd window does not close, What to do to close the cmd window and execute rest of the script?

Upvotes: 1

Views: 2091

Answers (1)

user7377479
user7377479

Reputation:

use this :

start-process $exepath

and if you want to run process form CMD use this :

Start-Process cmd "/c start calc"

Upvotes: 3

Related Questions