How Windows customizes USB drive letter, folder icon, folder background

Source: Internet
Author: User

Custom USB drive letter, folder icon, folder background

Note for Vista and Win7 users do not support the replacement of folder icons and folder backgrounds

1. Custom Drive letter:
Create a new file Autorun.inf in the root of the USB stick (you can first build a. txt text document and then rename it to Autorun.inf), and open the following entry:
[Autorun]
Icon=*.ico
Where, *.ico for your icon file path (what, you won't make an ico icon?). Hurry to see my previous article), if the icon in the root directory, then directly enter the icon file name, such as Icon=u-ico.ico, if the icon file is not in the root directory of the USB stick, enter its relative path, such as Icon=\utubiao\u-ico.ico. Save exit, now reinsert the USB drive, the drive letter is not changed?
2. Customize the folder (subfolder) icon in the USB flash drive:
Create a new folder, such as a photos, on a computer or a partition (for example, the D: Disk), and you will be ready. ico icon paste in, modify (Photos) folder icon for the icon just put away (method: Right-click to view folder properties >> Customize >> change Icon ...) );
Open the folder, in the address bar then \photos input \desktop.ini, that is, D:\photos\desktop.ini, enter, open the file Desktop.ini, inside the content is basically divided into 3 parts. Modify the absolute path of the. ico file after all "iconfile=" to a relative path, that is: Iconfile=photo.ico (the third part is a bit messy, also the same as the deletion of modifications), such as:
[. ShellClassInfo]
Iconfile=photo.ico
Iconindex=0
[. SHELLCLASSINFO.A]
Iconfile=photo.ico
[. SHELLCLASSINFO.W]
Iconfile=photo.ico
Save exit, copy and paste this folder into your USB stick directory, then put something inside.
Note that the above-mentioned Desktop.ini file is automatically created when the folder icon is modified, and its properties are system files, so it is generally possible to see, so for convenience, directly enter the file address to open the editor. In order to display the corresponding icon on the USB stick, we just changed the absolute path of the. ico reference file into a relative path. Similarly, if your. ico file is not in the appropriate folder, you will need to use a relative path reference as defined in the above letter.
3. Custom USB flash drive background Image:
Through the above two steps, I will not say more here. Create a new text file named Desktop.ini, write the following code save close, and then re-open the USB flash drive or refresh, the background is replaced by the picture you specified udesk.jpg:
[Extshellfolderviews]
[{BE098140-A513-11D0-A3A4-00C04FD706EC}]
Iconarea_image=\pics\desk\udesk.jpg
If you want to define a subfolder background, edit the Desktop.ini file that was created when the folder icon is defined above, and add the above (define the background) code before the original content.
To prevent accidental deletion and to confuse other files, it is recommended to modify the Autrun.inf,. ico and Desktop.ini file properties to "Hide", and of course, after the above changes, your USB stick will become more beautiful, but the folder expansion speed will also be affected, Especially after the definition is much more. In addition, some anti-virus software will not automatically run the USB stick, or even directly delete the Autorun.inf file, the corresponding, your USB drive letter or system default appearance. If you want to restore the system style, under Folder Options >> View tab, select Show protected system files, hide files, and then directly delete the files mentioned above.
In more detail, modifying them into system properties makes it difficult for others to see or even prevent others from deleting these files: Use a DOS command, execute cmd in a DOS command Prompt window or run, and enter the following command: (assuming U-disk letter is G)
attrib G:\autorun.inf +r +h +s (gives Autorun.inf read-only, hidden, System Properties)
If you want others to be unable to delete Autorun.inf, (antivirus software does not know) can also use the following two commands, but only if your USB drive format must be NTFS format (USB drive system format FAT/FAT32 to NTFS lossless conversion command: Convert K:/fs:ntfs , this command does not delete the files on the USB flash drive).
cacls k:\autorun.inf/p everyone:n (Disable all user access Autorun.inf)
cacls k:\autorun.inf/p everyone:r (gives all users the right to read Autorun.inf, except for write, delete rights)
After the above settings, all users can only read Autorun.inf, and can not modify or delete them, and even prevent some low-level autorun.inf virus intrusion on your USB stick. If one day you find the U disk icon has changed, it means that you probably in the Autorun.inf virus, quickly on your U disk and computer Antivirus it!
After the above several lines of command, is not also afraid when do not want this icon and helpless ah? The following is the corresponding removal of the USB drive letter solution:
cacls k:\autorun.inf/p everyone:f (gives all users full control over Autorun.inf)
OK, you can go to the U disk to delete Autorun.inf and *.ico, eject the USB flash drive and re-insert, you will find the icon of the USB stick has been changed back.

How Windows customizes USB drive letter, folder icon, folder background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.