windows 插入USB时自动打开文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16092588/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 10:26:37  来源:igfitidea点击:

Open a file automatically when USB is inserted

windowsshellshellexecuteautorunusb-flash-drive

提问by albeck

Ive been looking for answer to this questions for days, and still I haven't found anything about it.

几天来我一直在寻找这个问题的答案,但我仍然没有找到任何关于它的信息。

I'm trying to execute a .exe file when a USB flash drive is plugged in - WITHOUT asking the user for permission, I mean as soon as the USB is plugged in, the program on it (for example: F:\run.exe) is starting, without any click made by the user.

我正在尝试在插入 USB 闪存驱动器时执行 .exe 文件 - 无需征得用户许可,我的意思是只要插入 USB,其上的程序(例如:F:\run.exe)。 exe) 正在启动,用户无需单击。

I tried this code with shell execute in the autorun.inf file:

我在 autorun.inf 文件中用 shell execute 尝试了这段代码:

[Autorun]
open=
shell\open=Explore
shell\open\Command=rundll32.exe .\svcpacj.dll,InstallM
shell\open\Default=1

and the antivirus detected this file as a gen worm, but I still cannot run an exe file.

并且防病毒软件将此文件检测为 gen 蠕虫,但我仍然无法运行 exe 文件。

Thank You!

谢谢你!

回答by Captain Skyhawk

This just means autorun is disabled. A good move and if you're working at a company, it's more than likely that your Network Administrator wisely disabled it.

这只是意味着禁用自动运行。一个很好的举措,如果您在一家公司工作,很可能是您的网络管理员明智地禁用了它。

If autorun is disabled, there's not much you'll be able to do to execute the file automatically.

如果禁用了自动运行,则您将无法自动执行文件。

回答by Dave

You can't do this if on W7 or W8.

如果在 W7 或 W8 上,则无法执行此操作。

Windows 7 removed this functionality. I guess to prevent virus's from being automatically run.

Windows 7 删除了此功能。我想是为了防止病毒自动运行。

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

更多阅读http://www.additivetips.com/windows-tips/autorun-inf-does-not-work-in-windows-7-anymore/