Home  |  How To  |  Freeware  |  Tips & Tweaks  |  Reviews  |  Links  |  Search  | Sitemap


PC911 > How-To > Windows > AutoRun
- By Alex

Autorun - Automatically executing a file


What is AutoRun?

You probably have noticed this at one point or another. You inserted a CD, either a software CD or a music CD, into your CD-ROM drive, and suddenly a window appears out of nowhere on your screen and/or music suddenly starts playing. Nope, it's not black magic and there is no little gremlin inside your PC pushing the Play button. It's the Windows AutoRun feature.

How does it work?

The way this works is that Windows checks your CD-ROM drive every five seconds to see if a CD has been inserted. If it detects a CD in the drive, it will then look at the contents of the CD and see if there is a file called Autorun.inf. (Note: It works slightly different with music CDs but more about that later.) If it finds such a file, it opens it and executes the command found in that file.







Go ahead and take a look. Insert one of your program CDs into your CD-ROM drive, for example your Windows CD. Within a few seconds of inserting that CD, you will get the Windows welcome screen. Close that screen by clicking on the X in the top right corner. Now let's see what just happened. Open Windows Explorer and select the CD-ROM drive. Now look for a file called Autorun.inf. When you found it, highlight it by clicking on it once, then hold down the Shift key on your keyboard and right-click on the file. In the resulting menu, select Open With ... You'll get a window where you want to choose Notepad. In the Notepad window, you'll see something like this:


The first line tells Windows that this is indeed an autorun file and that the following command is to be executed.
The second line tells Windows to OPEN the file AUTORUN.EXE which can be found at the path CDSAMPLE\AUTORUN on the CD.
The third line tells Windows to display the icon WIN98CD.ICO, which can be found at CDSAMPLE\AUTORUN on the CD, for this CD in the Explorer window.
Don't believe me? Go see for yourself. On the Windows CD, find the folder CDSAMPLE\AUTORUN. And it contains exactly those two files.

Ok, we know that it works. But how can you disable the AutoRun feature if you suspect it causes CD-ROM problems or just don't want it to launch the CD you are about to insert

Page 2: How to disable autorun






Copyright 1998-2005. All rights reserved. Contact webmaster for copyright information & reproduction permissions.Last updated March 2005