Jump to content
Sign in to follow this  

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

How do you get it to open any html file?

Thank you

Share this post

Link to post
Share on other sites

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)
            ConsoleWrite($aTemp[1] & " found." & @CRLF)


Edited by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.