devxlogo

Launch another process in a specified directory

Launch another process in a specified directory

The System.Diagnostics.Process class provides several methods to launch and controls other Windows processes. For example, the following code sample shows how to run Notepad, pass arguments to it, and run it from inside a given intial directory:

' this code assumes that you have used this Imports statement' Imports System.DiagnosticsDim proc As New Process()' Prepare to run Notepad and load C:Autoexec.bat in it.proc.StartInfo.FileName = "Notepad.exe"' (Change the following statement to match your system.)proc.StartInfo.WorkingDirectory = "c:winnt"proc.StartInfo.Arguments = "c:autoexec.bat"' Run it.proc.Start()

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist