Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Shell and Wait

Posted on December 14, 2013October 26, 2015 By David Kittell
Public Sub ShellandWait(ByVal ProcessPath As String)
        Dim objProcess As System.Diagnostics.Process
        Try
            objProcess = New System.Diagnostics.Process
            objProcess.StartInfo.FileName = ProcessPath
            objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
            objProcess.Start()

            'Wait until the process passes back an exit code
            objProcess.WaitForExit()

            'Free resources associated with this process
            objProcess.Close()
        Catch
            MessageBox.Show("Could not start process " & ProcessPath, "Error")
        End Try
    End Sub
Try
  ShellandWait(System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) & "NormanNpmBinniu.exe")
Catch ex As Exception
End Try
 public void ShellandWait(string ProcessPath)
        {
            System.Diagnostics.Process objProcess = null;
            try
            {
                objProcess = new System.Diagnostics.Process();
                objProcess.StartInfo.FileName = ProcessPath;
                objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
                objProcess.Start();

                //Wait until the process passes back an exit code
                objProcess.WaitForExit();

                //Free resources associated with this process
                objProcess.Close();
            }
            catch
            {
                MessageBox.Show("Could not start process " + ProcessPath, "Error");
            }
        }
Originally Posted on December 14, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code VB.NET

Post navigation

Previous post
Next post

Related Posts

Alter Table

Posted on June 25, 2013October 26, 2015

With this statement you would need to make sure that the column you wish to change does not currently have NULL values before running it otherwise you will likely have errors. ALTER TABLE <TableName> ALTER COLUMN <ColumnName> int NOT NULL; GO With this statement you need to make sure that…

Read More

PowerShell – Windows 7 – Windows Service Cleanup

Posted on November 9, 2015

There are many services on Windows 7 that do not need to run, while some suggest disabling the service I tend to go on the side of caution and simply stop and set them to manual startup. # Stop Services and set to Manual # Home Group Sharing – start…

Read More

PowerShell – Random Password Generator

Posted on March 25, 2016January 31, 2017

Similar to C# – Random Password Generator but this will work with PowerShell scripts. This script has a minimum of four (4) characters but you can change that to whatever you would like. .\RandomPasswordGenerator.ps1 <Password Length> <# .SYNOPSIS New-RandomPassword generates a random password .DESCRIPTION New-RandomPassword generates a random password that…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • PowerShell - IIS Remove Site
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - FTP Upload Directory With Sub-Directories
  • Raspberry Pi - Remove Default Apps
  • PowerShell - Change Windows CD/DVD Drive Letter
©2025 David Kittell | WordPress Theme by SuperbThemes