Windows Autorun for an HTML file

2019-08-31 15:01发布

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?

This is my latest Attempt:

[autorun]

icon=data/favicon.ico

label=My Project

open=ShellRun.exe OPEN-ME.htm

This was another attempt:

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

1条回答
Evening l夕情丶
2楼-- · 2019-08-31 15:40

You might try to use VBScript or JScript:

  • test.vbs (VBScript):

    Call WScript.CreateObject("WScript.Shell").Run("OPEN-ME.html", 1)
    
  • 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.

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

查看更多
登录 后发表回答