AutoPlay is a feature in Windows that will automatically scan a device when it is connected to your computer and based on your settings, will either perform a specified action or do nothing at all. In order to understand AutoPlay, 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, It's intended to make installing apps for non-technicians 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
Read more