12

When I used my USB stick to install Ubuntu, the USB appears with an Ubuntu icon in My Computer.

Is it possible to customize this icon to something I want?

5
  • PriestVallon, is there a reason why you accepted and then revoked your decision? If my answer did not answer your question, please leave a comment so the community or I can address any related issues. Thank you. :)
    – iglvzx
    Jul 10, 2012 at 16:55
  • I accepted but then I thought I better check to make sure it works before I accept it. I haven't had time to check. So there's nothing wrong with your answer I just have to try it. Jul 10, 2012 at 18:25
  • Okay. That makes sense. Let me know if you run into any problems with this solution.
    – iglvzx
    Jul 10, 2012 at 18:35
  • Side question, will this method work for Ubuntu and OSX? Jul 10, 2012 at 21:45
  • 1
    I don't know. Autorun.inf is a Windows convention. However, it would not be difficult for other OS's to read only parts of the Autorun.inf file, such as icon and label, and then work with that information.
    – iglvzx
    Jul 10, 2012 at 21:51

2 Answers 2

19

Yes. You can customize the icon and label as shown by Windows Explorer by editing (or creating) the Autorun.inf file in the root folder of the removable drive.

The path for the icon is relative:

[Autorun]
Icon=my_icon.ico
Label=My Drive

Note: After making changes to (or creating) the Autorun.inf file, you may have to eject the drive and reconnect it for changes to reflect.


See also:

1
  • 1
    and don't forget to put my_icon.ico file at drive root if you use above code for autorun.inf Jul 10, 2012 at 4:40
4

Another way to accomplish this is to use desktop.ini. (Actually, on USB drives, I use both autorun.inf and desktop.ini). This technique has the virtue that it also works for individual folders. Simply create your desktop.ini file with contents similar to:

[.ShellClassInfo]
InfoTip=Some descriptive text here
IconFile=.\icons\DriveUSB.ico
IconIndex=0

Where I have a folder called "icons" which contains an assortment of icon files. I can then customize this (and autorun.inf if needed) as the need arises to display an appropriate icon. Also, when you mouse over the folder icon, your descriptive text will be displayed.

You'll also want to set the "system" and "hidden" attributes on the file (desktop.ini) to make sure that Windows gives it the special treatment that it deserves. You can do this in the GUI or with the command:

attrib +s +h +r desktop.ini

For more information on desktop.ini, see this MSDN article.

2
  • 1
    I would suggest this method and creating autorun.inf as folder instead of a file to protect the usb drive from some malware/virus. This way they can't create an autorun.inf file to do their dirty stuff. Jul 10, 2012 at 21:24
  • 1
    Actually precisely by security reasons I have chosen to take no action when an usb is inserted, so autorun.inf would not work Feb 3, 2015 at 17:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .