【问题标题】:Hard Drive Autorun Program硬盘自动运行程序
【发布时间】:2013-09-30 18:58:08
【问题描述】:

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

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

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

它包含以下内容:

[自动运行] 打开=hello.exe

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

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

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

Windows XP 专业版。 SP 3。

【问题讨论】:

    标签: c# windows vb.net autorun


    【解决方案1】:

    一般来说,当不是本地管理员组成员的登录用户调用自动运行时,可能会显示“安装失败”消息(在 Vista 上,您可能需要右键单击 autorun.inf并选择“以管理员身份运行”)。

    此外,这里有几个链接,其中包含有关自动运行的一般信息(以及“NoDriveTypeAutoRun”注册表项

    为您使用 Microsoft Visual Studio .NET 创建的应用程序创建自动运行 CD-ROM:-

    步骤是

    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) 在“文件名”文本框中,键入您在步骤 3 中构建的可执行文件的绝对路径,然后单击“打开”。

    9) 在构建菜单上,单击构建解决方案。 10) 启动任何文本编辑器(如记事本)。

    Paste the following code in the text editor, and then save the file as Autorun.inf:
    
    [autorun] 
    open=Setup.exe  
    

    注意:- 要为您在步骤 3 中构建的 Visual Studio .NET 应用程序准备 Autorun CD-ROM,请将步骤 9 中生成的文件和您在步骤 11 中创建的 Autorun.inf 文件复制到光盘。

    【讨论】:

      猜你喜欢
      • 2014-02-26
      • 2011-08-06
      • 2020-07-15
      • 1970-01-01
      • 1970-01-01
      • 2011-06-26
      • 1970-01-01
      • 2012-12-29
      • 1970-01-01
      相关资源
      最近更新 更多