Results 1 to 16 of 16

Thread: [RESOLVED] Execute CMD commands in VB with parameters

Threaded View

  1. #8
    Wall Poster TysonLPrice's Avatar
    Join Date
    Sep 2002
    Location
    Columbus, Ohio
    Posts
    3,969

    Re: Execute CMD commands in VB with parameters

    Since you are using .Net I'd suggest looking at using "Process" Shell is similar to Process.Start and you have more control:

    https://www.dotnetperls.com/process-vbnet

    CreateNoWindow: Specifies that you want to run a command line program silently without flashing a console window.

    You can also trap warning and see if you want to act on them or ignore them.

    Here is a sample I use just to give you the flavor:

    Code:
    Dim mProcess As New Process
    
                mProcess.StartInfo.WorkingDirectory = "C:\_Team\_Deploy\SQL\LTR1TEAMSQLUA CMISQL\Rating"
                mProcess.StartInfo.FileName = "SVN"
                mProcess.StartInfo.Arguments = "update 2_ToDeploy"
                mProcess.StartInfo.RedirectStandardOutput = True
                mProcess.StartInfo.RedirectStandardError = True
                mProcess.StartInfo.UseShellExecute = False
                mProcess.StartInfo.CreateNoWindow = False
    
                mProcess = Process.Start(mProcess.StartInfo)
    
                pOutput = mProcess.StandardOutput.ReadToEnd
                pError = mProcess.StandardError.ReadToEnd
                mProcess.WaitForExit()
    Last edited by TysonLPrice; Jun 3rd, 2019 at 01:22 PM.
    Please remember next time...elections matter!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width