自动播放(AutoPlay)是Windows中的一项功能,它会在设备连接到您的计算机时自动扫描设备,并根据您的设置执行指定的操作或不执行任何操作。但是,为了了解AutoPlay,您还必须了解另一个非常相似的功能,称为AutoRun。
大多数人认为AutoRun 和 AutoPlay(AutoRun and AutoPlay)只是同一事物的两个术语,但这是不准确的。 自动运行是(AutoRun)Windows 95中首次出现的一项功能 !它到底有什么意义?让非技术人员更容易安装应用程序。如果 CD 的根目录(root directory)中包含名为 autorun.inf 的文件,Windows会自动检测到它并按照该文件中的说明进行操作。
这个文件通常非常简单,基本上只是指向光盘上的一个文件,通常是安装文件(setup file)或安装文件。下面是一个示例:
在Windows XP和更早版本中,文件将被读取并自动运行,无需任何提示。如果您曾经为某个硬件或Windows XP或更早版本中的程序弹出安装(Windows XP)CD/DVD,它就会开始运行安装程序。
这显然带来了严重的安全风险,微软(Microsoft)引入了自动播放(AutoPlay)作为解决问题的一种方式。 AutoPlay的工作是检查新连接的媒体设备,确定上面的内容类型,然后显示一个对话框,允许用户启动应用程序来播放、运行或显示内容。
现在,根据您运行的操作系统, (operating system)AutoRun 和 AutoPlay(AutoRun and AutoPlay)的工作方式会有所不同。在Windows Vista之前的所有Windows版本中,AutoRun在(AutoRun)AutoPlay之前执行,除非AutoRun被禁用。如果未禁用,AutoRun将执行并搜索AutoRun.inf文件。
在Windows XP中,如果找到autorun.inf 文件(autorun.inf file),AutoRun可以继续并完全绕过AutoPlay并启动应用程序,而无需先询问用户。
在Windows Vista和更高版本中,AutoRun不能跳过AutoPlay。如果有AutoRun.inf 文件(AutoRun.inf file),它仍然会被读取,但不是自动启动应用程序,而是会弹出一个对话框,其中包含选项列表,其中一些可能来自(dialog box)autorun.inf 文件(autorun.inf file)。
自动运行与自动播放示例
为了完全清楚地说明这一点,让我们通过一个例子来说明。我有一张MSI 驱动程序(MSI driver)CD,我会弹出到Windows XP、Windows 7和 Windows 10 看看会发生什么。AutoRun.inf 文件(AutoRun.inf file)是上面屏幕截图中显示的简单文件。
在Windows XP中,读取光盘,找到一个autorun.inf 文件(autorun.inf file),并在屏幕上自动弹出MSI 安装程序。(MSI setup)
但是,当我将同一张 CD 弹出到Windows 7中时,我会得到以下自动播放对话框(AutoPlay dialog):
如您所见,它正在尝试运行 autorun.inf 文件中提到的DVDsetup.exe(autorun.inf file)文件,(DVDsetup.exe file)但现在您可以选择。Windows 10也是如此。在这里,您首先会在屏幕上收到通知。
如果单击它,它将弹出自动播放对话框(AutoPlay dialog),您可以在其中选择要执行的操作。
总体而言,即使您可以在Windows 7及更高版本中禁用(Windows 7)自动播放功能(AutoPlay feature),它也不会损害您的计算机,因为未经您的许可无法执行任何程序。自动播放(AutoPlay)所做的只是检测媒体并为您显示选项。
另一方面,如果您运行的是Windows XP ,禁用 AutoRun(disable AutoRun)可能是个好主意,因为在该操作系统(operating system)上,程序仍然可以在未经用户同意的情况下运行。
在 Windows 7 中配置自动播放
值得注意的是,在Windows 7中,您可以更改自动播放(AutoPlay)设置,以便它们模仿它在Windows XP中的工作方式。这可能不是您想要做的事情,但它是一种选择。
要配置自动播放(AutoPlay),请单击开始并输入(Start and type)自动播放(autoplay)。选择顶部的第一个选项。
这将显示一个绝对庞大的项目列表,您可以单独配置这些项目。值得庆幸的是,此列表在Windows 10(Windows 10)中已大大减少,如下所示。请注意,如果您想在Windows 7(Windows 7)中完全关闭自动播放(AutoPlay),只需取消选中最顶部的对所有媒体和设备使用自动播放框。(Use AutoPlay for all media and devices)
放入软件 CD时出现(software CD)弹出对话框(popup dialog)的原因是软件和游戏(Software and games)设置为每次都询问我(Ask me every time)。您可以将其更改为从您的媒体安装或运行程序(Install or run program from your media)、打开文件夹以查看文件(Open folder to view files)或不采取任何操作(Take no action)。
可供选择的选项列表将根据所连接的媒体类型而有所不同。例如,音频CD 或 DVD 电影(CD or DVD movie)可以选择使用Windows Media Player 播放(Windows Media Player)。如果您将设备与图片或视频连接,您可以选择自动导入这些项目。除了标准项目之外,如果您曾经将其他设备(如智能手机或平板电脑(smartphone or tablet))连接到您的计算机,这些设备将显示在最底部。
在 Windows 10 中配置自动播放
在Windows 10中,单击“开始”并输入(Start and type)“自动播放(AutoPlay)”以打开“自动播放设置”(AutoPlay Settings)对话框。如您所见,只有两个选项,而不是Windows 7中的众多选项。与Windows 7一样,如果您连接了任何其他外部设备,这些设备将显示在Removable Drive and Memory Card之后。
就您可以采取的行动而言,这些选项几乎相同。对我来说,每次我连接我的 iPhone 时,它都会尝试将它们导入OneDrive,这是我不希望发生的。这是您可以将其关闭的地方。
根据我的测试,当您插入DVD 或 CD(DVD or CD)时,似乎使用了Memory Card的选项。
由于大多数人使用的是最新版本的Windows,因此您真的不必再担心AutoPlay以外的任何事情。如果您愿意,在Windows中禁用或启用自动播放也是一个简单的过程。(AutoPlay)如果您有任何问题,请随时发表评论。享受!
How to Configure AutoPlay in Windows 7 & 10
ΑutoPlay is a feature in Windоws thаt will automatically scan a device when it is connected to your computеr and based on your settings, will either perform a specified action or do nothing at all. In order to understand AutоPlay, though, you also have to understand another very similar feature called AutoRun.
Most people think AutoRun and AutoPlay are just two terms for the same thing, but that is not accurate. AutoRun is a feature that first came out in Windows 95! What was the point of it exactly? To make installing apps for non-techies easier. If a CD contained a file called autorun.inf in the root directory, Windows would detect it automatically and follow the instructions in that file.
This file is normally very simple and basically just points to a file on the disc, usually the setup file or install file. Here is an example of one below:
In Windows XP and earlier, the file would be read and automatically run without any kind of prompt. If you have ever popped in an install CD/DVD for a piece of hardware or a program in Windows XP or earlier, it would just start running the setup program.
This obviously posed serious security risks and Microsoft introduced AutoPlay as a way to fix the problem. AutoPlay’s job is to examine a newly connected media device, determine what kind of content is on it, and then display a dialog that allows the user to launch an application to play, run or display the content.
Now depending on the operating system you are running, AutoRun and AutoPlay will work differently. In all versions of Windows earlier than Windows Vista, AutoRun is executed before AutoPlay, unless AutoRun is disabled. If it’s not disabled, AutoRun will execute and it will search for the AutoRun.inf file.
In Windows XP, if the autorun.inf file is found, AutoRun can go ahead and bypass AutoPlay altogether and launch the application without asking the user first.
In Windows Vista and higher, AutoRun cannot skip past AutoPlay. If there is an AutoRun.inf file, it will still be read, but instead of the application being launched automatically, a dialog box will pop up with a list of choices, some of which could be from the autorun.inf file.
AutoRun vs. AutoPlay Example
To make this totally clear, let’s go through an example. I have a MSI driver CD with me that I will pop into Windows XP, Windows 7 and Windows 10 to see what happens. The AutoRun.inf file is the simple one shown in the above screenshot.
In Windows XP, the disc is read, an autorun.inf file is found and the MSI setup program automatically pops up on the screen.
However, when I pop the same CD into Windows 7, I instead get the following AutoPlay dialog:
As you can see, it’s trying to run the DVDsetup.exe file mentioned in the autorun.inf file, but now you get the option to choose. The same is true for Windows 10. Here you first get a notification on your screen.
If you click on that, it will bring up the AutoPlay dialog where you can choose what action to perform.
Overall, even though you can disable the AutoPlay feature in Windows 7 and higher, it’s not going to harm your computer because no program can be executed without your permission. All AutoPlay does is detect the media and display the options for you.
If you’re running Windows XP, on the other hand, it might be a good idea to disable AutoRun because on that operating system, programs can still be run without user consent.
Configure AutoPlay in Windows 7
It’s worth noting that in Windows 7 you can change the AutoPlay settings so that they mimic how it works in Windows XP. This is probably not something you would want to do, but it’s an option.
To configure AutoPlay, click on Start and type in autoplay. Select the first option at the top.
This will bring up an absolutely giant list of items that you can individually configure. Thankfully, this list has been greatly reduced in Windows 10 as you’ll see below. Note that if you want to turn off AutoPlay completely in Windows 7, just uncheck the Use AutoPlay for all media and devices box at the very top.
The reason I got the popup dialog when putting in my software CD was because Software and games was set to Ask me every time. You can change this to Install or run program from your media, Open folder to view files, or Take no action.
The list of options to choose from will vary depending on what type of media is connected. For example, an audio CD or DVD movie will have the option to played using Windows Media Player. If you connect a device with pictures or videos, you’ll have the option to automatically import the items. In addition to the standard items, if you ever connected other devices to your computer like a smartphone or tablet, those will show up at the very bottom.
Configure AutoPlay in Windows 10
In Windows 10, click on Start and type in AutoPlay to open the AutoPlay Settings dialog. As you can see, there are only two options instead of the numerous in Windows 7. As with Windows 7, if you connected any other external device, those will show up after Removable Drive and Memory Card.
The options are pretty much the same in terms of the actions you can take. For me, every time I connected my iPhone, it would try to import them into OneDrive, which I did not want to happen. This is the place where you can turn that off.
From my testing, it seems like the options for Memory Card are used when you pop in a DVD or CD.
Since most people are using the latest versions of Windows, you really no longer have to worry about anything other than AutoPlay. It’s also a straight-forward process to disable or enable AutoPlay in Windows if you like. If you have any questions, feel free to comment. Enjoy!