Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Computer Forums > Programmers Lounge > Programming Discussions » Firefox + Optimizer Script
Closed Thread
Old 10-22-2008, 12:11 AM   #1 (permalink)
PhikMan's Avatar
 
True Techie

Join Date: Jun 2008

Location: In My Own Reality...Quite Comfy Really...

Posts: 128

PhikMan is on a distinguished road

Lightbulb Firefox + Optimizer Script

Do you run Firefox and firefox ultimate optimizer and hate having the optimizer running all the time, even when ur not using firefox?
Well here's a script i threw together just then, just run it and it will open firefox + the optimizer, and when your finished just close firefox and the script will close the optimizer for you! its as easy as that!
Yeah ok, im just showing off now, its boring, but seriously. I thought i might give this to others and see what u guys think. any suggestions and/or comments are welcome

Code:
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer
Dim Running
dim objshell

Set objShell = CreateObject("WScript.Shell")

objshell.Run "E:\FirefoxUltimateOptimizer.exe"
objshell.Run "firefox.exe"

Running = "True"
strComputer = "."

Do While Running = "True"
    Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" _
    & strComputer & "\root\cimv2")

    Set colProcess = objWMIService.ExecQuery _
    ("Select * from Win32_Process")

    Running = "false"

    For Each objProcess in colProcess
        If objprocess.name = "firefox.exe" then
            Running = "True"
        end if
    Next
loop
For Each objProcess in colProcess
    If objprocess.name = "FirefoxUltimateOptimizer.exe" then
        objprocess.terminate()
    end if
Next
WScript.Quit
just copy and paste into notepad, change "E:\FirefoxUltimateOptimizer.exe" to path of ur optimizer file ( I think it has to be at the root of a drive, thats the only way i could get it to work) and simply save as a .vbs file.
just run it and viola! firefox and optimizer!:eek::eek:
__________________
Intel Q9450 @2.6 + TRUE
Asus Maximus Formula...ugg...
4 Gig Corsair Domiator
Inno3D 9800 GTX OC edition
Coolermaster 700W
Seagate 500 and 320 Gig and WD 80 Gig SATA II
Coolermaster RC 690
Samsung 206BW 20"
PhikMan is offline  
Old 10-22-2008, 03:46 AM   #2 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Firefox + Optimizer Script

Nice script PhikMan . Doesn't look like there could be any improvments to the code that I see.
__________________

Baez is offline  
Old 10-22-2008, 08:24 AM   #3 (permalink)
PhikMan's Avatar
 
True Techie

Join Date: Jun 2008

Location: In My Own Reality...Quite Comfy Really...

Posts: 128

PhikMan is on a distinguished road

Default Re: Firefox + Optimizer Script

thanks cvb724!! i just hope that some people find it useful. and it sure beats opening and closing optimizer every time u run firefox, cause i hate having things running all the time that arnt being used...
And i must admit, google was my friend...i knew what i wanted to do and i have some rudementry vb coding abilities, but i had too look up how to access the running process list.
__________________
Intel Q9450 @2.6 + TRUE
Asus Maximus Formula...ugg...
4 Gig Corsair Domiator
Inno3D 9800 GTX OC edition
Coolermaster 700W
Seagate 500 and 320 Gig and WD 80 Gig SATA II
Coolermaster RC 690
Samsung 206BW 20"
PhikMan is offline  
 
Closed Thread

Tags
firefox, optimizer, script

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer 8 Features And Their Firefox Equivalent Osiris Browser & General Internet Questions 0 08-28-2008 10:32 AM
Firefox market share exceeds 20%, Internet Explorer dips below 70% maroon1 News & Polls 1 08-03-2008 12:55 AM
Firefox 3.0.1 Drops Tomorrow, July 16, 2008 Mak213 Browser & General Internet Questions 5 07-17-2008 02:44 AM
Download Firefox 2.0.0.16 - Firefox 2.0 One Step Closer to Death Mak213 Browser & General Internet Questions 0 07-15-2008 03:01 PM
Firefox 3 Final Portable Osiris Browser & General Internet Questions 5 06-28-2008 03:31 AM