So I am just playing with batch files and was curious if it was possible to create a batch file that opens the google browser and without typing into the search box, a variable from my batch file gets put into the search box. Anyone know if that's possible? Thanks.
@echo off
cd c:\program files (x86)\google\application
start chrome.exe www.youtube.com
I can open the web browser, I can even change the code to store the variable, but need to know how to send that variable to the search engine. Youtube i just the website i left it at.
If you use google as search engine, try to pass the keyword like this :
and if you want add more than a keyword just add the sign +
You could send raw HTTP request as follows:
Below is possible approach how-to make it more readable in a batch script (non-systematic approach, as e.g.
site
variable joins together protocol and host name). Use appropriate value ofengine
variable for a particular host (as it could vary for different servers):Delayed expansion used as any variable in above code could contain
cmd
poisonous characters.