Can't open .bat file!

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 --kiosk
After the change(Cannot be opened by processing)
“Chrome\Application\chrome.exe” https://www.arsandbox.cn/ImageSwitchP5000/index.html --kiosk

The purpose is to open the chrome browser in my current folder.

As mentioned above, I can click the bat file to open it with the mouse, but the processing can’t open it anyhow. The path of the bat file is the same and there is no change.

code
launch(sketchPath("")+"data/9.bat");
This is the file path in data.
5a718223a9263168fb395ba5c5b509a

Hello,

This worked for me:

/* 
 * Launch Example 1
 * v1.0.0
 * GLV 2021-04-12

 * Launches Google Chrome
*/

void setup() 
  {
  //Works:
  //println(sketchPath("")+"data/go.bat");
  //launch(sketchPath("")+"data/go.bat");
  
  //Works:
  println(sketchPath("")+"data\\go.bat");
  launch(sketchPath("")+"data\\go.bat");
  }  

go.bat in \data folder:

REM notepad.exe
start "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "www.howtogeek.com"
pause

How to format:
FAQ - Processing Foundation

Reference:
https://www.howtogeek.com/663927/how-to-open-google-chrome-using-command-prompt-on-windows-10/

:)

1 Like

Hi guy. Thank you for your reply!

There is no problem with your method, I can open it, but the problem is that when I move the chrome file to my project data folder, I can’t open it with the chrome browser.

8f158bd1325c73c9cf264d10c31efc0

(This can open a chrome browser I installed :point_down:)

start "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" "www.howtogeek.com"
pause

(This will not be able to open the chrome browser in the data folder, but the default IE browser opens :point_down:)

start "Chrome\Application\chrome.exe" "www.howtogeek.com"
pause

I’m so sorry I don’t know if you can understand the problem I’m expressing

To put it simply, I am not sure whether the computer I want to use has a chrome browser, so I want to bring a chrome browser decompressed program, and then I want to specify the chrome browser in my own data to open the website I specify.but it not work.

Hello,

Working example:

/* 
 * Launch Example 1
 * v1.1.0
 * GLV 2021-04-13

 * Launches Google Chrome Portable installed in sketch folder (see paths in code)
 * https://portableapps.com/de/apps/internet/google_chrome_portable
*/

void setup() 
	{ 
  //Works:
  println(sketchPath("")+"data\\GoogleChromePortable\\GoogleChromePortable.exe www.howtogeek.com");
  launch(sketchPath("")+"data\\GoogleChromePortable\\GoogleChromePortable.exe www.howtogeek.com");
  }

:)

2 Likes

That’s great buddy! This has been bothering me for a few days, and it has been solved perfectly now! ! I’m very much obliged to you! I’m so excited! !

1 Like

Hi glv! I’m so sorry to bother you again. I found that the software that opens the processing Output program by this command does not work.

println(sketchPath("")+"data\\ProcessingOutput\\Processing.exe ");

Do you know why? :upside_down_face: