Creating a new process to run a new application from a running program

Abstract :


This code demonstrates how to start a new application from current program.


'Below statement will create a new process
Dim Notepadprocess As New Process()
'Here provide the name of the executable which has to be run from the applcation
Notepadprocess.StartInfo.FileName = "notepad.exe"
'Provide the name of the file to be opened in the editor as an argument
Notepadprocess.StartInfo.Arguments = "Name of the file you have to open"
'Start the process using the below command
Notepadprocess.Start()



A code similar to the above one can be used to open applications like internet explorer from your running application with a pre-defines website in a similar way. Code would be:


'Below statement will create a new process
Dim internetexplorer As New Process()
'Here provide the name of the executable which has to be run from the applcation
internetexplorer.StartInfo.FileName = "iexplore.exe"
'Provide the name of the file to be opened in the browser as an argument
internetexplorer.StartInfo.Arguments = "Name of the website you have to open"
'Start the process using the below command
internetexplorer.Start()


Comments

No responses found. Be the first to comment...


  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: