How to Autorun a .html file from USB drive? File should be run on Mac and Windows Both.

I'm using this but it's not working


2 Answers 2


HTML files are not executable and therefore they can not be run.

If you use an autorun.inf file on the medium, you need to specify the executable that will render the file. Only executables perform a task. Other files don't "do" anything. Types that execute include .exe, .scr, .chm, and .com.

  • I just used [autorun] open=launch.bat and put start loading-intro.html in launch.bat but still not working Jul 23, 2011 at 6:28
  • 5
    Autorun has been disabled on USB as of the last couple of months, for security reasons. See support.microsoft.com/kb/971029.
    – user3463
    Jul 23, 2011 at 6:32
  • 1
    "Start" only works with executables, too. You can't "start" a file that does not do anything.
    – Abraxas
    Jul 23, 2011 at 6:34
  • 1
    You can use shellexecute= to open an .html file. It is open= which can only start executables.
    – paradroid
    Jul 23, 2011 at 7:06
  • It does not seem to work that way for me. But, picture CD's usually have a slide-show executable on them. Windows would no doubt consider starting a program from a CD as a security risk. So it would be easy enough to put a portable browser on the CD and then set autorun.inf to start the browser. shellexecute=chrome.exe loading-intro.html
    – Abraxas
    Jul 23, 2011 at 11:35

According to the Autorun.inf Wikipedia page, you can use:

shellexecute=[filepath\]filename [param1 [param2 ...]]

However, Autorun only works with CD/DVD on Vista or later, IIRC, and has recently been disabled in XP, for security reasons, as mentioned by Randolph West.

  • It seems to work fine on all versions of Windows before XP, not just Vista and 7. It also works fine on my XP, which is up to date. But I installed a scanner for optical drives which may have re-enabled it.
    – Abraxas
    Jul 23, 2011 at 11:39
  • @Abraxas: I don't think you read that last sentence how I intended it to mean. XP used to run autorun.inf from any drive, including fixed hard drives, but does not any more. An updated installation of XP has the same behaviour as Vista and Win7 now. The link above gives more details.
    – paradroid
    Jul 23, 2011 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .