How to auto run a file from a CD or DVD or a pen drive

Auto run is the process by which a program or a file is started when you insert a CD or DVD or a removable storage like a pen drive.

You can control which file to start by configuring the autorun.inf file which is present in the root of the CD or pen drive.

To write the autorun.inf file use the following code:

Just copy the following code and paste it into notepad and save it save autorun.inf

[autorun]

open = name of file to be started along with the extension

icon = icon_file_name.ico

For example,

[autorun]

open = s.exe

icon = a.ico

Note that both the files are to be in the same location as that of the autorun.inf that is they should be also in the root folder.

Now copy the autorun.inf, file to be started and the icon file to the root of the CD or the removable drive.