Sign in to follow this  
Followers 0
MohamedRagab

Internet Explorer Problem

4 posts in this topic

Hello All Members

I just wanted to make an .htm file that was created by the AutoIt as in the code below

so that simply i click the item to open or to browse it

$search = FileFindFirstFile("*.*")

; Check if the search was successful

If $search = -1 Then

MsgBox(0, "Error", "No files/directories matched the search pattern")

Exit

EndIf

While 1

$file = FileFindNextFile($search)

If @error Then ExitLoop

$file1 = FileOpen("c:\list.txt", 2)

FileWriteLine($file1, $file & @CRLF)

FileClose($file1)

Run ("iexplore c:\list.txt")

;If( $file <> "list.au3") Then

; MsgBox( 4096, "File:" & $file , $file )

;EndIf

WEnd

; Close the search handle

FileClose($search)

The ouptut in the file is : . , that is all i got

Also the SciTE says :

c:\list.au3 (16) : ==> Unable to execute the external program.: Run ("iexplore c:\list.txt")

The system cannot find the file specified.

And the file "list.txt" is really created

I tried to make Run ("c:\list.txt") but with no result and the same message appear

I hope to find the answer

Thanks for Your time

Mohamed

list.au3

Share this post


Link to post
Share on other sites



1. wrong forum!

2.

Run( "notepad.exe " & "c:\list.txt" , @WindowsDir )

@WindowsDir - becouse its in windows,

and iexplore is NOT in windows dir, so you need to run it :

run ( @ProgrammFilesDir & "\internet explorer\iexplore.exe " & "C:\test.txt" , here the path again )


My UDF's : Startet on : 06.06.2006_CaseSearchOrReplaceStr();~> Searches OR Replaces a String,;~> With or Without Casesensivity

Share this post


Link to post
Share on other sites

:) like this

;Search where !!!
$search = FileFindFirstFile("c:\*.*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    
    $file1 = FileOpen("c:\list.txt", 1); Option 1
    FileWriteLine($file1, $file & @CRLF)
    

;If( $file <> "list.au3") Then 
;   MsgBox( 4096, "File:" & $file , $file )
;EndIf
WEnd

; Close the search handle
FileClose($file)

run("C:\Program Files\Internet Explorer\iexplore.exe" &" c:\list.txt")

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

; Find fullpath to iexplore.exe
$fullpath_iexplore = RegRead('HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\IEXPLORE.EXE', '')
If @error Then
    $fullpath_iexplore = @ProgramFilesDir & '\Internet Explorer\iexplore.exe'
EndIf

$search = FileFindFirstFile("*.*")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

$file1 = FileOpen("c:\list.txt", 2)
If $file1 <> -1 Then
    While 1
        $file = FileFindNextFile($search) 
        If @error Then ExitLoop
        FileWriteLine($file1, $file)
    WEnd
; Close the file handle
    FileClose($file1)
; Run Iexplore.exe
    If FileExists($fullpath_iexplore) Then
        Run($fullpath_iexplore & " c:\list.txt")
    Else
        MsgBox(0x10, '', 'iexplore.exe not found')
    EndIf
Else
    MsgBox(0x10, '', 'FileOpen error')
EndIf

; Close the search handle
FileClose($search)

Edit:

Updated a lonely single quote to a double quote matched pair

Edited by MHz

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