Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
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 '12 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. –  PriestVallon Jul 10 '12 at 18:25
    
Okay. That makes sense. Let me know if you run into any problems with this solution. –  iglvzx Jul 10 '12 at 18:35
    
Side question, will this method work for Ubuntu and OSX? –  PriestVallon Jul 10 '12 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 '12 at 21:51
add comment

2 Answers

up vote 17 down vote accepted

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:

share|improve this answer
1  
and don't forget to put my_icon.ico file at drive root if you use above code for autorun.inf –  tumchaaditya Jul 10 '12 at 4:40
add comment

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.

share|improve this answer
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. –  Mavromatis Lozay Jul 10 '12 at 21:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.