Open Chrome Command line without 1st run new tabs

2k views Asked by At

I am using a command line script to open a particular web page in Chrome and send keypresses to that web page

When Google Chrome opens for the 1st time chrome opens up its own Tab e.g. welcome to chrome/login to chrome and this throws everything off.

I dont want any new tabs generated I want only the web page I asked for

Is there a command line switch or method to force chrome to not generate its own tabs. Perhaps registry entry etc?

I have tried some but no success so far

Thanks

Confuseis

1

There are 1 answers

0
turbo On

Since your question contains the AutoIt tag, I have to assume you want an AutoIt solution.

The best way to do this would be to use chromes --new-window command line switch. This opens a new instance of Chrome, with a single tab pointing to the URL provided, by executing the chrome executable via ShellExecute.

$sPath = @HomeDrive & "\Program Files (x86)\Google\Chrome\Application"
ShellExecute($sPath & '\chrome.exe', '--new-window "https://www.google.com/"', $sPath, "", @SW_MINIMIZE)