How do you customize the icon on a USB stick?

12

3

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?

PriestVallon

Posted 2012-07-05T23:42:07.977

Reputation: 474

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 – 2012-07-10T16:55:31.987

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. – PriestVallon – 2012-07-10T18:25:42.300

Okay. That makes sense. Let me know if you run into any problems with this solution. – iglvzx – 2012-07-10T18:35:01.650

Side question, will this method work for Ubuntu and OSX? – PriestVallon – 2012-07-10T21:45:37.597

1I 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 – 2012-07-10T21:51:02.600

Answers

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:

iglvzx

Posted 2012-07-05T23:42:07.977

Reputation: 21 611

1and don't forget to put my_icon.ico file at drive root if you use above code for autorun.inf – tumchaaditya – 2012-07-10T04:40:35.100

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.

BillP3rd

Posted 2012-07-05T23:42:07.977

Reputation: 5 353

1Actually precisely by security reasons I have chosen to take no action when an usb is inserted, so autorun.inf would not work – მამუკა ჯიბლაძე – 2015-02-03T17:51:00.270

1I 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. – Mavromatis Lozay – 2012-07-10T21:24:39.903