Sign in to follow this  
Followers 0
Dilip11

open any browser

9 posts in this topic

hi i m not able to open any browser using run()..

and also...

i m using processlist()

like

$list1 = ProcessList("IEXPLORER.exe")

$list1 = ProcessList("firefox.exe")

like all browser...

but i not able to do this....

Share this post


Link to post
Share on other sites



Post the code you tried to run Firefox with, so we can help you

Share this post


Link to post
Share on other sites

Hi Dilip11

try, Run(@ProgramFilesDir & "\Internet Explorer\iexplore.exe")

Because iexplore.exe and firefox.exe are not in the "PATH" environment variable.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

Post the code you tried to run Firefox with, so we can help you

i m using following code to watch the process

if WinExists("Mozilla Firefox") Then
MsgBox(0, "Mozila is open:", $title)
EndIf

if WinExists(" Windows Internet Explorer") Then

MsgBox(0, "Internet is open:", $title)
EndIf

i try so many function

but not get result....

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Did you try Hannes123's solution? What was the result?

Try this to run Firefox, assuming you used the default install directory

$iPID = Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe")

Edit: Added the run Firefox bit

Edited by smartee

Share this post


Link to post
Share on other sites

$list1 = ProcessList("IEXPLORER.exe")

IEXPLORER.exe doesn't exists, it's iexplore.exe

Remember that ProcessList function returns an array

listing the currently running processes (names and PIDs).

Also ShellExecute can open default browser ! Posted Image


AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Also ShellExecute can open default browser

Yes, good point wakillon ;)

@Dilip11: Try wakillon's advice, certainly this works for you :)

ShellExecute("http://www.google.com")

Share this post


Link to post
Share on other sites

you can filter you winlist result like this

#include <Array.au3>

$_WinList = WinList ( "[REGEXPCLASS:(IEFrame|Mozilla|Chrome)]" )
For $_I = 1 To UBound ( $_WinList ) -1
    If $_WinList[$_I][0] <> '' Then
        $_Classname = _WinGetClassName ( $_WinList[$_I][1] )
        If $_Classname Then
            ConsoleWrite ( '-->-- Title : ' & $_WinList[$_I][0] & @Crlf )
            ConsoleWrite ( '+->-- Classname : ' & $_Classname & @Crlf )
        EndIf
    EndIf
Next

Func _WinGetClassName ( $hWnd )
    If Not IsHWnd ( $hWnd ) Then $hWnd = WinGetHandle ( $hWnd )
    $aClassName = DLLCall ( "user32.dll", "int", "GetClassName", "hWnd", $hWnd, "str", "", "int", 64 )
    If Not @error And $aClassName[0] <> 0 Then Return $aClassName[2]
EndFunc ;==> _WinGetClassName ( )

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

Thnks its Helpful to me....

Thnks To all

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0