The key to making an automatic running CD is to compile the autorun. inf file. The method to automatically run the executable file is very simple, but it may not be how to make autorun. inf that automatically runs the HTML file? The following describes three methods for automatically running HTML files.
First: Use third-party Application Files
Set the followingCodeWrite to notepad, but save it as auotrun. inf:
[Autorun]
Opentracing shelexec.exe index.html
The file shelexec.exe is a third-party application file. It not only supports running HTML files, but also supports calling txt, Doc, JPG and other files.
The latest version is v1.14, download address: http://www.naughter.com/shelexec.html shelexec
Type 2: Use wsh
Wsh (Windows Scripting host) is one of the Microsoft Script Technology series. It uses a script engine to explain and execute scripts, such as Microsoft VBScript and JScript. Next we will compile a simple VBScriptProgramTo call HTML files.
Autorun. vbsSource code:
Dim wshshell
Set wshshell = wscript. Createobject ("wscript. Shell ")
Wshshell. Run ("index.html ")
Then write the auotrun. inf file:
[Autorun]
Opentracing wscript.exe Autorun. vbs
Third: directly run html
For Windows 2000/XP/2003 operating systems, the auotrun. INF code can be written in the following method:
[Autorun]
Shellexecutew.index.html
For Windows 95/98 operating systems, the auotrun. INF code can be written as follows:
[Autorun]
Open = start index.html
The above three methods can be used to automatically run HTML files. If you consider the compatibility of the operating system, the first method is the best. If you pay attention to convenience, you can use the third method.