# Using launch() to start chrome.exe

**URL:** <https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765>\
**Category:** Coding Questions\
**Created:** [July 14, 2024, 11:01am UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765 "2024-07-14T11:01:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorgensen](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jorgensen](https://discourse.processing.org/u/jorgensen)\
**Post date:** [July 14, 2024, 11:01am UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/1 "2024-07-14T11:01:33Z")

</div>

I’m trying to launch chrome.exe via launch();  
It works fine if I just want to start chrome.exe. My issue is that I can’t figure out how to pass an url to chrome.exe.

If I start chrome via command shell with an url it works just fine, but nothing happens if I du the same using launch(“C:/Program Files/Google/Chrome/Application/chrome.exe [https://www.nationalgeographic.com](https://www.nationalgeographic.com)”).

Does anyone know what I do wrong?

Thanks 🙂  
Jorgensen

---

<div class="post-metadata">

**Author:** ![mnse](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mnse/32/16520_2.png) [@mnse](https://discourse.processing.org/u/mnse)\
**Post date:** [July 14, 2024, 11:52am UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/2 "2024-07-14T11:52:49Z")

</div>

Hi @jorgensen,

You need to separate the program from arguments…  
Try:

`launch(“C:/Program Files/Google/Chrome/Application/chrome.exe","https://www.nationalgeographic.com");`

Cheers  
— mnse

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [July 14, 2024, 11:57am UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/3 "2024-07-14T11:57:04Z")

</div>

Hello @jorgensen ,

This works on W10 with Processing 4.3:

```auto
/* 
 * Launch Example 1
 * v1.1.1
 * GLV 2024-07-14
*/

void setup() 
  { 
  //Works:
  String s = "\"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe\" www.howtogeek.com";
  println(s);
  launch(s);
  }

```

I had to modify reference below for new location and spaces.

Reference:

> [@Can't open .bat file!](https://discourse.processing.org/t/cant-open-bat-file/29299):
>
> Hi guys, I’m here again. This time the question confuses me. I want to use processing to open the bat file to open Google Chrome, and use launch(sketchPath("")+“data/9.bat”); to solve it. The problem is, but when I change some things in the bat file, I can’t open it with processing, but I can open it with a single mouse click in the folder. original (Can be opened by processing) “C:\Program Files\Google\Chrome\Application\chrome.exe” "[https://www.arsandbox.cn/ImageSwitchP5000/index.html](https://www.arsandbox.cn/ImageSwitchP5000/index.html) --kio…

There may be other ways to do this.

_[String / Reference / Processing.org](https://processing.org/reference/String.html)_ will explain this:

> [@glv](#):
>
> `\"`

`:)`

---

<div class="post-metadata">

**Author:** ![jorgensen](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jorgensen](https://discourse.processing.org/u/jorgensen)\
**Post date:** [July 14, 2024, 1:44pm UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/4 "2024-07-14T13:44:23Z")

</div>

Thanks to both glv and mnse for a very quick and helpfull reply!

So simple, I just did’nt know that parameters needed to be added that way 🙂

Thanks  
Jorgensen

---

<div class="post-metadata">

**Author:** ![jorgensen](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jorgensen](https://discourse.processing.org/u/jorgensen)\
**Post date:** [July 15, 2024, 6:52am UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/5 "2024-07-15T06:52:44Z")

</div>

I’ve got it to work the way I wanted - and exported via File \> export application - so cool.

I just wonder if there is a way to shorten the startup time for the app?  
When I press the shortcut, it takes 4-5 seconds before the app starts.

Can I install open java as part of windows so the app does not need to load java before starting? Could that shorten the startup time? Or is there other tricks - or is that just the way it is?

Thanks  
Jorgensen

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [August 27, 2025, 10:51pm UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/6 "2025-08-27T22:51:29Z")

</div>

here for firefox

```auto

  case "Launch3":
    String[] args1 = {
      "C:\\Program Files (x86)\\Mozilla Firefox\\firefox.exe",
      lastCmd
    };
    println("Launch");
    launch (args1);
    break;

```

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [August 28, 2025, 4:14am UTC](https://discourse.processing.org/t/using-launch-to-start-chrome-exe/44765/7 "2025-08-28T04:14:15Z")

</div>

> [@Chrisir](#):
>
> here for firefox

Firefox is in a different location on my W10 Processing 4.4.6 PC:

```auto
String url = "https://www.howtogeek.com/";

String[] args = {
  "C:\\Program Files\\Mozilla Firefox\\firefox.exe",
  url
};
launch (args);

```

The above works!

`:)`
