Quantcast
Viewing all articles
Browse latest Browse all 15705

VS 2012 Run cmd minimized

Hi! Quick question that I hope someone can answer.
Basically I have a bit of code which when runs opens a cmd window. What I'm wondering is would it be possible to run the cmd window minimimzed?

Here's what I have:
Code:

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        TextBox1.Text = "Dir"
        TextBox2.Text = "tree"
        TextBox3.Text = "mkdir temp"

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim psi As New ProcessStartInfo()
        psi.Verb = "runas"
        psi.FileName = ("cmd.exe")
        psi.Arguments = "/c " & TextBox1.Text & " && " & TextBox2.Text & " && " & TextBox3.Text 'dir|more"

        Try
            Process.Start(psi)

        Catch
            MsgBox("User cancelled the operation", 16, "") ' User pressed No
        End Try

    End Sub


Viewing all articles
Browse latest Browse all 15705

Trending Articles