Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was used to keeping some shortcuts of my program in a folder which is included in PATH, so whenever I want to launch any of them, I simply hit Win+R, then the name of the program. As for websites, I used the shortcut of Chrome, and append the url in that shortcut's properties's Target bar.

Now my question is: Is there a way that allows me to search on internet directly from the RUN prompt? As for now I have to hit Win+R, then CH(Name of my shortcut of Chrome), at last input the search string in address bar. As you can see, there are three steps, I want to cut it to two.

To be more specific, for example, when I input CH target in RUN prompt, I expect it to open Chrome, and search target string using my default search engine of Chrome. Similarly, if I input IE target, I hope it can launch IE and search using my default search engine of IE.

share|improve this question
    
Could you be more specific? Do you want to search using a specific site? Do you want the results to be displayed in chrome or otherwise? –  Raystafarian Jul 14 '13 at 9:14
    
Edited to be more specific.@Raystafarian –  Elderry Jul 14 '13 at 9:27
    
start www.google.com/search?q=test will open the browser and search google, from command prompt. You don't want to specify the website in the prompt as this adds to the time it takes, correct? –  Raystafarian Jul 14 '13 at 9:37
    
I think there is a little misunderstanding. I want to search directly from the RUN prompt, not the command prompt. And yes, I don't want to specify the website, I want it to use my default search engine, like when I input some key words in my browser's address bar and hit Enter. –  Elderry Jul 14 '13 at 10:17
    
Ah, yes, I did misunderstand. Apologies! –  Raystafarian Jul 14 '13 at 10:18

4 Answers 4

up vote 1 down vote accepted

Simply make a bat-file called CH and place it in PATH, and let it look something like this:

@echo off
if [%1]==[] (
    explorer.exe "C:\Users\Username\AppData\Local\Google\Chrome\Application\chrome.exe"
) else (
    explorer.exe "https://www.google.com/search?q=%1+%2+%3+%4+%5+%6+%7+%8+%9" 
)
exit

Explorer.exe opens the url in default browser, and with this you can search for up to nine words, if that's not enough there are ways to shift through all commandline arguments in batch, but nine ought to suffice. If you only search for one word, google will ignore the extra +'s.

Edit: Now if you don't pass it any arguments, i.e. only type CH it will open chrome to its default homepage.

Edit2: Here are some more you can use aswell:

I'm Feeling Lucky: "http://www.google.com/search?q=%1+%2+%3+%4+%5+%6+%7+%8+%9&btnI"
IMDB: "http://www.imdb.com/find?q=%1+%2+%3+%4+%5+%6+%7+%8+%9"
Wikipedia: "http://en.wikipedia.org/w/index.php?search=%1+%2+%3+%4+%5+%6+%7+%8+%9"

To clarify, this works from the RUN prompt and from the commandline prompt.

share|improve this answer
    
Exactly what I want! –  Elderry Jul 15 '13 at 0:48

Since explanation of the question suggests that you want to reduce the steps in searching through your default search engine with the help of keyboard shortcuts. My answer will help you do just that.

Pin your default browser to your taskbar.

Press "Windows" + "the index of your browser in the taskbar".

Say your browser is at the 5th location on your taskbar, starting from left. Then press "windows" + "5" and your browser will open directly.

you can set your default search engine to look for your keyword on your browser by doing this in Firefox.

1)Type 'about:config' in address bar. Now it is advised that do not change anything here which you have no idea about. This will also be evident from the warning which you get.... Moving on, a page with 4 columns will get displayed.

2)Type 'keyword.URL' in filter box. Just one option will be visible now.

3)Right-Click on that option and select modify. A box will be displayed.

4)Enter any of the following string for corresponding search engine:

For Google: "http://www.google.co.in/search?btnG=Google+Search&q="

For Wikipedia: "http://en.wikipedia.org/wiki/Special:Search?fulltext=Search&search="

For Yahoo: "http://search.yahoo.com/search?p="

I hope you are getting the drift by looking at the above queries.

Now the next time Firefox is opened through you one step keyboard shortcut. Just type in your keyword in your URL bar and off you fly.

Do your bit of research for finding similar tweaks in other browsers if Firefox is not the browser of your choice.

share|improve this answer
    
Sorry for my finicky, but I prefer a more uniform way and have a strange interest to keep my desktop and taskbar clean, so both of them in my computer is empty, since I open nearly everything with Win+R. Thanks anyway, if no better solution appeared, I will accept yours. –  Elderry Jul 14 '13 at 11:48

Yes you can... you just need to do this

  1. Go to Run
  2. copy/paste or type www.google.com/search?q=
  3. and then the query you want to search

If there is a space in between words just add a plus sign +

For example: www.google.com/search?q=super+user

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.