Jump to content

How to open any html file within a folder


Recommended Posts

How would I open any html file that is in a folder.  The folder would have only one html file but the file name will be different every time. Here is what I am using but it does not like the wildcard.

#include <ie.au3>

$sFile = "C:/temp/*.html
$sURL = "file:///" & $sFile
_IECreate($sURL)

How do you get it to open any html file?

Thank you

Link to comment
Share on other sites

  • Moderators

Hi, xcaliber13. Look at _FileListToArray in the help file. Read the contents of the folder into your array to get the filename, then use that in your script.

Edit: something like this to get you started

#include <File.au3>

$aTemp = _FileListToArray(@DesktopDir & "\Test", "*.htm", $FLTA_FILES)

    If IsArray($aTemp) Then
        If $aTemp[0] > 1 Then
            ConsoleWrite("More than one HTML file found!" & @CRLF)
        Else
            ConsoleWrite($aTemp[1] & " found." & @CRLF)
        EndIf
    EndIf

 

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...