Subscribe:

Tuesday 25 March 2014

Create Autorun File For Pen Drives

Create Autorun File For Pen Drives

What Is Autorun.inf File ?

autorun.inf is an information file which runs whenever any usb drive is plugged in the usb portof the PC. It contains the instructions for the programs to run whenever the usb device is plugged in. Please note that if autorun function is disabled in your pc, the autorun file you are going to make will not work.

What Is The Use Of Autorun.inf File ?

Well, autorun.inf is very useful for the optical disks as well as usb drives also. You might have seen that sometimes, when you insert some disks of games or softwares, the setupautomatically runs or any menu appears to choose the options. This is because of theautorun.inf file. When you insert the disk, the autorun.inf file runs automatically and instruct the computer to run the setup (because it is instructed in autorun.inf file)
In usb drivesautorun.inf files are used to change the icon of the drive, change the background image, run a program when usb is plugged in etc. But, some people create virus codes and save the code in pen drives in the form of autorun.inf file and whenever the infected pen drive is plugged into the pc, the pc gets infected by the virus, because the virus is activatedautomatically through autorun.inf file.

How To Create Autorun.inf File ?

To create an autorun.inf file for the pen drive, you need to open notepad, type the autorun instruction and then save it as autorun.inf in the root of the pen drive, means in the main drive of pen drive.

Changing The Icon Of USB Drive With Autorun.inf :

  • Open notepad.
  • Type this instruction code:
  • [autorun]
    icon=myicon.ico
    label=MyLabel
  • Save it as autorun.inf in your pen drive's root.
  • Eject your pen drive and re insert it in usb. You will see that the icon of your pen drive is changed.
pen drive icon changed
Note: Before creating the autorun.inf file, copy and paste any icon (with extension .ico) in the root of your pen drive. Replace myicon.ico with the name of the icon you pasted in the pen drive's root. Replace MyLabel with the name you want to show as the drive name. In my testing, I have used a green check sign as icon and PC Tricks Guru as label text.

Running An EXE File Automatically When USB Drive is plugged in:

  • Open notepad.
  • Type this instruction code:
  • [autorun]
    open=file.exe
    icon= icon.ico
    label=YourLabel
  • Save it as autorun.inf in the root of your pen drive.
  • That's it. Eject and re-insert your pen drive. The exe file will run automatically. (This works with CD/DVD mostly)
Note: Keep the icon file and exe file in the root of the pen drive to work it properly.

0 comments:

Post a Comment

Pc tricks
Powered by Conduit Mobile