Scsal
Scsal

Reputation: 11

Batch file to open navigator AND WRITE on the window

I need a batch file which can open the navigator start "" www.google.com and write some text on the box "search". For example I want to open a .bat which after opening google on chrome, inputs some words for research

What can I do?

Upvotes: 0

Views: 283

Answers (2)

Hackoo
Hackoo

Reputation: 18827

You can try something like that if you want to open in new tab or in new window :

@ECHO OFF
Set "KeyWord=Batch file to open navigator AND WRITE on the window"
Set "NewWindow=--new-window"
Set "NewTab=--new-tab"
echo Starting new search in new tab :
Start "" chrome.exe %NewTab% https://www.google.com?q="%KeyWord%"
cls
echo Hit any key to open the new search in new window
pause>nul
Start "" chrome.exe %NewWindow% https://www.google.com?q="%KeyWord%"
cls
echo Type some keyword to be searched by google !
Set /P "InputKeyWord="
Start "" chrome.exe %NewWindow% https://www.google.com?q="%InputKeyWord%"
exit

Upvotes: 0

PKey
PKey

Reputation: 3841

Change directory to where Chrome.exe is located (cd) and run:

chrome.exe --new-window google.com?q="How to run chrome from command line"

Upvotes: 1

Related Questions