Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have the following batch file:

@echo off
REM Starts a chrome browser with multiple tabbed sites
C:UsersUserNameAppDataLocalGoogleChromeApplicationchrome.exe "site1.com" "site2.com"

But when I run it, it causes the prompt to hang and renders it unusable until Chrome is closed. (Or, if I am not using the prompt and run it from the icon, it opens a blank prompt that is unusable and disappears when Chrome is closed.)

Is there any way to prevent this? I.E. once the webpages are open, the prompt is no longer tied up.

It opens the webpages just fine. I've also noticed that if there's already a chrome window open, the batch runs fine (leaving a usable prompt), adding the tabs to the existing chrome session.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
402 views
Welcome To Ask or Share your Answers For Others

1 Answer

Have a look into the start command. It should do what you're trying to achieve.

Also, you might be able to leave out path to chrome. The following works on Windows 7:

start chrome "site1.com" "site2.com"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...