Jump to content

Running an HTML file with Autoit


Recommended Posts

I cant figure out how to run a html file with AutoIt. It won't work with the Run function. I cant figure it out!!! HELP PLEASE! I just want to run main.html which is in the same directory as the script. SOmebody please help!!

Thanks for any and all help!!

-nanascalala

Link to comment
Share on other sites

Having the failing piece of code is always usefull.

I guess you're using Run('main.html')?

Try Run(@ComSpec & ' /c start main.html') instead. Run can only run programs and an html file is no program.

Link to comment
Share on other sites

With NT4 start is an internal command belonging to the command interpreter. So If you use NT4, Win2k, XP, Win2k3 you need to use @ComSpec. If it should work on your PC you're running Win9x or somewhere on your system you have a command that's doing the same thing as the internal one... but that's no standard windows.

Link to comment
Share on other sites

With NT4 start is an internal command belonging to the command interpreter. So If you use NT4, Win2k, XP, Win2k3 you need to use @ComSpec. If it should work on your PC you're running Win9x or somewhere on your system you have a command that's doing the same thing as the internal one... but that's no standard windows.

ahhh... good to know. and thanks for fixing the wiki!

"I'm not even supposed to be here today!" -Dante (Hicks)

Link to comment
Share on other sites

This one works.  I use it.

RunWait("C:\Program Files\Internet Explorer\Iexplore.exe C:\FilePath\main.html", "",)

that'll work as long as IE is installed there, you know, instead of into "C:\that damned browser\\iexplore.exe" or, you know, somewhere else... you can pull that info from the registry, which would be much more reliable... 'course it all depends on the scope of your script's intended audience.

edit: btw, my linked referance includes this method.

Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

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...