Launch Chrome and Other Applications in C#

Hi Everyone,

I was recently asked if I could launch Chrome and other applications in C#. I couldn’t see a reason why we couldn’t, as it’s fairly easy to do this type of operation inside PowerShell.

This is only on Medium.com!

Updated 12th Feb 2025 – So this post has taken off recently, so I thought I would come back and update it. This’ll only really matter to me, but making sure my readers have the most up to date content always puts a twinkly in my eye!

Launch Chrome and Other Applications in C#

This all came about as I wanted to automate my start up procedure in the morning. I had a bunch of regularly used application and Chrome tabs that I was getting tired of starting manually. I thought

Why not spend all day automating it, rather than spending 5 minutes to open them?

Launch Chrome and Other Applications in C#

So I started inside my Program.cs file and created a new Process object. Using this object, I assigned some StartInfo. Let’s go through this one line at a time:

Create the new Process object:

Process process = new Process();

I could now pass in the path to my Chrome executable using the StartInfo.FileName variable:

process.StartInfo.FileName = @"C:\Path\To\Chrome.exe";

Now, I could pass in some Arguments to the process. Those mainly being the URLs I wanted to open:

process.StartInfo.Arguments = @"https://bbc.co.uk";

After this, I told the process to start a new window as I didn’t want it to add these tabs to any existing Chrome windows:

process.StartInfo.Arguments += " --new-windows";

I could then start the process and watch Chrome do exactly as I had told it:

process.Start();

Example Scenarios

Open a specific URL inside an existing Chrome window:

Process process = new Process();
process.StartInfo.FileName = @"C:\Path\To\Chrome.exe";
process.StartInfo.Arguments = @"https://bbc.co.uk" ;
process.Start();
Open a specific URL inside an existing Chrome window

Opening a URL in a new Chrome window:

Process process = new Process();
process.StartInfo.FileName = @"C:\Path\To\chrome.exe";
process.StartInfo.Arguments = @"https://bbc.co.uk";
process.StartInfo.Arguments += " --new-window";
process.Start();
Opening a URL in a new Chrome window

Opening multiple URLs in a new Chrome window:

List<string> URLs = new List<string>(){
    "https://bbc.co.uk",
    "https://mharwood.uk",
    "https://youtube.com"
};

Process process = new Process();
process.StartInfo.FileName = @"C:\Path\To\chrome.exe";
foreach (string i in URLs)
{
    process.StartInfo.Arguments += i;
}
process.StartInfo.Arguments += " --new-window";
process.Start();
Opening multiple URLs in a new Chrome window

Opening different programs:

List<String> Programs = new List<String>(){
    @"C:\Path\To\First\Program.exe",
    @"C:\Path\To\Second\Program.exe",
    @"C:\Path\To\Third\Program.exe"
};

foreach(string i in Programs){
    Process.Start(i);
}
Opening different programs

So as you can see, there are a ton of different options you can use to not only open a URL inside Chrome, but to also start any program on your computer. You just need to know the location of the applications executable file.

Enjoy! 🎉

Leave a Comment

Your email address will not be published. Required fields are marked *

email popup image
Mark Harwood
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
Subscribe
NEVER miss a blog post again! Subscribe for email notifications whenever a new post is live!
No obligation call, message, or email
Contact form image
I'll Be In Touch Soon