插入USB记忆棒后自动运行 [英] Autorun when USB stick is inserted

查看:138
本文介绍了插入USB记忆棒后自动运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图提示用户插入USB设备时运行我的安装程序。我希望此功能可以在所有(大多数?)Windows操作系统上使用。

I'm trying to prompt users to run my installer, whenever they plug in my USB device. I'd like this to work on all (most?) Windows OSes.

我的USB密钥的根目录中有一个autorun.inf文件,内容如下:

I have an autorun.inf file in the root dir of my USB key with these contents:

[Autorun]
ShellExecute=setup.exe
Icon=setup.exe
UseAutoplay=1

似乎根本没有做。嗯...确实可以正确更改图标,但是什么也不会执行,用户也不会收到任何提示。我已经在Windows 7和Windows Server 2003上都尝试过。

It doesn't seem to do very much at all. Well... it does change the icon properly, but nothing gets executed and the user doesn't get any prompts. I've tried it on both Windows 7 and Windows Server 2003.

有什么想法吗?

推荐答案

USB大容量存储设备在Windows上不执行自动运行。您需要枚举为USB CD-ROM设备才能支持自动运行。

USB mass storage devices do not perform Autorun on Windows. You need to enumerate as a USB CD-ROM device in order to support autorun.

如果您具有支持U3的USB驱动器,则通常可以用自己的CD映像替换U3数据。

If you have a U3 capable USB drive, you can often replace the U3 data with your own CD image.

如果这是自定义USB设备,则需要使用Mass Storage和USB CD-ROM设备(如果不想支持写入,则只需CD-ROM)来实现复合设备。

If this is a custom USB device, you will need to implement a composite device with the Mass Storage and USB CD-ROM device (or just the CD-ROM if you don't want to supporting writing).

这篇关于插入USB记忆棒后自动运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆