How to use autorun in Windows 7 from a Flash drive to open a webpage?

狂风中的少年 提交于 2019-11-30 18:49:56

问题


I've been trying to come up with a way to autorun a series of HTML pages that are hosted on a USB Flash Drive. These are all static pages, and are all linked to index.html in my flash drive's root.

I tried setting up an autorun.inf file like this:

[autorun]
open=index.html

I have also tried this:

[autorun]
shellexecute=index.html

And I have tried this:

[autorun]
open=wscript.exe autorun.vbs

where autorun.vbs looks like this:

Call WScript.CreateObject("WScript.Shell").Run("index.html", 1)

So far, I've had no luck in getting the application to even show up on the autorun dialog. I even had a more robust autorun.inf similar to this one:

[autorun]
shellexecute=index.html
label=Test Application
action=Start Test Application
shell\start=Start Application
shell\start\command=index.html
shell=start

I switched out various shellexecute/open commands in a number of different configurations. I then stumbled upon a page during my research that said "Windows 7 no longer supports autorun.inf from flash drives." but there was no other information about this that I could find.

Anyone have a solution? I only would like to insert the flash drive and have the webpage within opened without other user input. If I have to deal with an autoplay dialog that has a "Display page" button, that would also be fine.

Edit: I also tried this link: Windows Autorun for an HTML file but it did not work either.


回答1:


As stated in my comment, windows no longer allows this. Here is a previous Stack Overflow article:

Auto-Running a program from USB flash drive

and another one:

http://www.addictivetips.com/windows-tips/autorun-inf-does-not-work-in-windows-7-anymore/

To allow autoplay edit your settings here:

Control Panel->All Control Panel Items->AutoPlay




回答2:


This link at Microsoft might solve your problem. Their solution copied below in case of link rot:


I would suggest you to use any of the below mentioned method and check if you are able to use the AutoPlay feature for removable drives as USB.

  1. Click Start and in the Search box, type gpedit.msc and press Enter.
  2. Now browse to Computer Configuration\ Administrative Templates\ Windows Components\ Autoplay Policies\ Turn off Autoplay.
  3. Change the value of Turn off Autoplay to disabled.

You may refer to the below links for further assistance -
Change AutoPlay settings - http://windows.microsoft.com/en-US/windows7/Change-AutoPlay-settings
Troubleshoot AutoPlay problems - http://windows.microsoft.com/en-US/windows7/Troubleshoot-AutoPlay-problems


Good luck!



来源:https://stackoverflow.com/questions/10743322/how-to-use-autorun-in-windows-7-from-a-flash-drive-to-open-a-webpage

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!