views:

28

answers:

1

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.

A: 

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.

Dustin
Would the files need to be named anything specific. I tried autorun.vbs and autorun.js and couldn't get them to work.
No, there shouldn't be any specific file names. Try `wscript.exe autorun.vbs` or `wscript.exe autorun.js`. Also make sure you didn't disable your AutoRun/AutoPlay functionality (when you insert an installation disc that you own into your disc drive, does Windows automatically launch the setup program or the application that it installs? Most do.
Dustin