Open chrome in windows from the command line in a

2019-03-26 10:40发布

I tried this command from the cmd prompt:

start "c:\program files (x86)\google\chrome\application\chrome.exe" --new-window "http://localhost:8080:/debug?port=5858"

and I get "windows can not find '--new-window'

If I remove the start command, it works fine. If I leave the start command but remove the --new-window parm then the url is opened in my default browser (ie).

I've tried several variations of the above but can't get it to work.

What is the correct syntax for the start command to open chrome with the given url in a new window?

4条回答
Summer. ? 凉城
2楼-- · 2019-03-26 10:47

Try to put this in a batchfile, then you can play with size and position to:

start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://brianp.dk/" --window-size="2560,1000" --window-position="0,0" --user-data-dir="D:/Test/Profiles/1"
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://borsen.dk/" --start-maximized --window-position="2560,000" --user-data-dir="D:/Test/Profiles/2"
start "" "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window "http://penge.dk/" --window-size="1280,1000" --window-position="0000,1000" --user-data-dir="D:/Test/Profiles/3"
查看更多
Root(大扎)
3楼-- · 2019-03-26 10:53

In Windows 10, following command works:

start chrome --new-window "https://www.facebook.com"

This works perfectly in cmd.

查看更多
仙女界的扛把子
4楼-- · 2019-03-26 11:02

Answer is there : Using the "start" command with parameters passed to the started program

start "" "c:\program files (x86)\google\chrome\application\chrome.exe" --new-window "http://localhost:8080:/debug?port=5858"

(add empty title parameter at the beginning of the line)

查看更多
forever°为你锁心
5楼-- · 2019-03-26 11:08

I'm using Windows 10 And the following command works:

start chrome.exe
查看更多
登录 后发表回答