Dos Command query

colmac
StarLounger
Posts: 65
Joined: 01 Apr 2011, 18:43

Dos Command query

Post by colmac »

I have a small batch file to let me input a search term, then open a Google search, a google maps search, and a bing maps search for the input term.
@echo off
cls
start https://www.bbc.co.uk/" onclick="window.open(this.href);return false;
echo What do you want to search?
set /p search=
start https://www.google.co.uk/#q=" onclick="window.open(this.href);return false;%search%
start https://www.google.co.uk/maps/place/" onclick="window.open(this.href);return false;%search%
start http://www.bing.com/maps/default.aspx?q=" onclick="window.open(this.href);return false;%search%
The additional line start https://www.bbc.co.uk/" onclick="window.open(this.href);return false; is there as I've discovered that it enables the subsequent pages to open as tabs (IE11 in Win 7)

Two things I'd like a bit of help with

1 The line to open the BBC window takes the focus away from the DOS window, so I cannot start typing straight away

2 The input does not work with multiple words. So it will not work with as an example "New York"

Any help appreciated

Thanks


Colin

User avatar
HansV
Administrator
Posts: 78475
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dos Command query

Post by HansV »

1) Even without the line

start https://www.bbc.co.uk/" onclick="window.open(this.href);return false;

the links start in separate tabs for me - perhaps a general IE tab setting?

2) Use "%search%" (including the quotes) instead of just %search%.
Best wishes,
Hans

colmac
StarLounger
Posts: 65
Joined: 01 Apr 2011, 18:43

Re: Dos Command query

Post by colmac »

the links start in separate tabs for me - perhaps a general IE tab setting?
I should have added the rider that if IE is open then it seems to open OK as tabs. If IE is not open though then I find that I get three separate windows.

That may have something to do with speed of the machine however.

The "%search%" works perfectly though.

Thanks

User avatar
John Gray
PlatinumLounger
Posts: 5408
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: Dos Command query

Post by John Gray »

With start, it's usually worth including a null title in the command line using a pair of double-quotes:
start "" https://www.bbc.co.uk/" onclick="window.open(this.href);return false;
John Gray

"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...