Windows自动运行的HTML文件 [英] Windows Autorun for an HTML file
问题描述
我要在Windows中自动运行的闪存驱动器上有一个html文件。我发现了执行此操作的多种方法的示例,但没有一个对我有用。有人看到我在做什么错吗?
I have a html file on a flash drive that I would like to autorun in Windows. I have found examples of multiple ways to do this but none of them are working for me. Anyone see what I am doing wrong?
这是我最近的尝试:
[autorun]
icon=data/favicon.ico
label=My Project
open=ShellRun.exe OPEN-ME.htm
这是另一种尝试:
[autorun]
icon=data/favicon.ico
label=My Project
shellexecute=OPEN-ME.html
shell\openme=Learn More About My Project
shell\openme\command=OPEN-ME.html
shell=openme
其中某些功能正在起作用,例如图标和标签。只是没有自动运行。
Some of this is working, like the icon and the label. Just not the auto run.
推荐答案
您可能会尝试使用VBScript或JScript:
You might try to use VBScript or JScript:
-
test.vbs(VBScript):
test.vbs (VBScript):
Call WScript.CreateObject("WScript.Shell").Run("OPEN-ME.html", 1)
test.js( JScript):
test.js (JScript):
WScript.CreateObject("WScript.Shell").Run("OPEN-ME.html", 1)
无论哪种方式,它都应该做您想要的据我所知。
Either way, it should do what you want as far as I'm aware.
编辑:顺便说一句,ShellRun.exe很可能是与称为 ShellRun 而不是内置的Windows命令。这个想法是,您可以使用AutoRun文件中的可执行文件来启动任意文件。
By the way, ShellRun.exe is most likely a program bundled with a piece of software known as ShellRun rather than a built-in Windows command. The idea is that you can use the executable in your AutoRun file to launch an arbitrary file.
这篇关于Windows自动运行的HTML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!