Page 1 of 1

use ie to google all running tasks (for tokens delims)

Posted: 11 Dec 2011 13:01
by confuseis
for /f "tokens=1 delims=" %%A in ("c:\windows\system32\tasklist.exe") do "C:\Program Files\Internet Explorer\iexplore.exe" %%A ΒΆ


Hi all

above is where Im at so far. I want to use the tasklist command to list all processes running and then the above line to feed in the 1st word per line in the output (the name of the task) and essentially google each task running saving me the typing. maybe there is an easier way? In any case its a chance for me to learn this pesky for comand.

Thanks for reading.

Re: use ie to google all running tasks (for tokens delims)

Posted: 11 Dec 2011 13:44
by orange_batch

Code: Select all

for /f "delims=, tokens=1" %%a in ('tasklist /fo csv /nh') do start iexplore "http://www.google.com/search?q=%%~a"

My version of IE is 7 because I don't use it. Maybe newer versions support multiple websites via arguments like Firefox does. In that case, I would use this:

Code: Select all

@echo off&setlocal enabledelayedexpansion
for /f "delims=, tokens=1" %%a in ('tasklist /fo csv /nh') do set args=!args! "google.com/search?q=%%~a"
start iexplore !args!

Re: use ie to google all running tasks (for tokens delims)

Posted: 11 Dec 2011 14:52
by aGerman
Be careful! If you run approx. 100 instances of Internet Explorer your machine will probably freeze because of 100% CPU use.

Regards
aGerman

Re: use ie to google all running tasks (for tokens delims)

Posted: 18 Dec 2011 11:09
by confuseis
That works great mate. Now to begin learning the code. Yeah it does tie the processor up momentarily but still quicker than googling each individually

Thanks guys and Merry Chrstmas