0

我正在尝试运行一个程序,一旦用户双击硬盘驱动器(不是 Windows 硬盘驱动器)。

我的想法是:创建一个 autorun.inf 文件,一旦用户点击硬盘,程序就会执行。

我遇到的问题...我的 autorun.inf 文件无法正常工作。

它包含以下内容:

[自动运行] open=hello.exe

当我右键单击 .inf 文件并单击“安装”时,它给了我一个错误 - “安装失败”。

任何关于 autorun.inf 文件或运行我的程序的其他方式的帮助,将不胜感激。

我的电脑操作系统规格是:

Windows XP 专业版。战略计划 3。

4

1 回答 1

1

On a general note, the 'Installation Failed' message can be displayed when autorun is invoked by a logged on user who is not a member of the local Administrator's group (on Vista, you may need to right-click autorun.inf and select 'Run as administrator').

Also, here are several links that have general information on autorun (and the 'NoDriveTypeAutoRun' registry entry

Create an Autorun CD-ROM for Applications That You Create by Using Microsoft Visual Studio .NET :-

Steps are

1) Start Visual Studio .NET.
2) Create a simple Console Application or Windows Application.
3) Build the application.
4) On the File menu, point to New, and then click Project.
5) In Project Types, click Setup and Deployment Projects. In Templates, click Setup    projects
6) Name the project Setup, and then click OK.
7) In Solution Explorer, right-click your Setup project, click Add, and then click File.

8) In the File name text box, type the absolute path of the executable that you built in step3, and then click Open.

9) On the Build menu, click Build Solution. 10) Start any text editor (such as Notepad).

Paste the following code in the text editor, and then save the file as Autorun.inf:

[autorun] 
open=Setup.exe  

Note :- To prepare an Autorun CD-ROM for the Visual Studio .NET application that you built in step 3, copy the files that were generated in step 9 and the Autorun.inf file that you created in step 11 to the CD-ROM.

于 2013-09-25T10:31:40.743 回答