ProcessStartInfo - Execute it in Hidden Window

With the following code I am executing the cmd file
when I execute this DOS window gets open

Could someone please let me know how to execute this
in Hidden window, I don't want to popup DOS window

Dim startupInfo As New ProcessStartInfo
startupInfo.FileName = "C:\outage\outage_assetx\Outage_assetx.cmd"

startupInfo.UseShellExecute = True
startupInfo.RedirectStandardOutput = False
startupInfo.CreateNoWindow = True

Dim AssetCostProcess As New Process
AssetCostProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
AssetCostProcess = Process.Start(startupInfo)

If Not AssetCostProcess.HasExited Then
     AssetCostProcess.WaitForExit()
End If

AssetCostProcess.Close()




Answer this question

ProcessStartInfo - Execute it in Hidden Window

  • nebiecoder

    With the addition of the following line of code

    startupInfo.WindowStyle = ProcessWindowStyle.Hidden

    My problem got fixed

    Thanks

  • ProcessStartInfo - Execute it in Hidden Window