我需要一个可以打开导航器start "" www.google.com
的批处理文件
并在“搜索”框上写下一些文字。
例如,我想打开一个.bat,在Chrome上打开google后输入一些用于研究的单词
我该怎么办?
答案 0 :(得分:1)
将目录更改为Chrome.exe所在的位置(cd
)并运行:
chrome.exe --new-window google.com?q="How to run chrome from command line"
答案 1 :(得分:0)
如果您想在新标签页或新窗口中打开,可以尝试类似的操作:
@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