28

I have a tons of folders in my Python directory and I would like to change the color of a couple of folders to red. Is this possible without installing additional software?

  • Does your IDE not allow the marking or highlighting of folders in the project? – Burgi Jun 2 '17 at 17:49
  • I mainly use Jupyter notebook and sometimes the default IDE (IDLE). I'm not sure of such an option. I think the more advanced IDEs like Pycharm might have an option? I will have to look into it. – moondra Jun 2 '17 at 18:08
  • 2
    The key point is lost in the details of the answers: Windows does not support changing the color of an individual folder, but it supports custom icons for individual folders; and those can look like anything including folder icons of a different color, if you have such an icon. – Euro Micelli Jun 4 '17 at 16:18
33

The default icon set in Windows is a little limited but you can get free icons off the internet. I used IconFinder. I downloaded this red folder as an experiment:

icon

You need to download the ico file from that site. I recommend saving them in a directory somewhere away from the folders you are editing.

Right click the folder you want the customise and select properties and then click on the "Customise" tab.

Folder properties

Click "Change icon" then you can browse through the window of the default icons or click "Browse" and navigate to your downloaded icons and select the one you want.

Icon chooser dialog

Then click OK and click "Apply" on the properties dialog box. Your folder will have now changed to the one you chose.

Folder with a red icon

If you can't find any icons you like you can make your own in Paint and save them as a 64x64 gif then change the suffix to ico.

If you want to change back to the default icon you can go to the icon chooser dialog (second picture) and click "Resore Defaults". This will return the folder to the Windows default folder icon.

  • Oops! Didn't notice it was there! – moondra Jun 2 '17 at 17:59
  • 3
    suffix --> extension – jpmc26 Jun 2 '17 at 23:17
  • 3
    Save it as gif (not png)? – JDługosz Jun 3 '17 at 9:13
  • For the editor, I would suggest paint.net with the IcoCur plugin. – Gras Double Jun 4 '17 at 3:56
  • Is changing the filename extension necessary, or can you set the file selector to show all file types? – deltab Jun 4 '17 at 17:56
28

You can use PowerShell! I wrote this script that generates an icon of the color you specify and sets it as the icon of a given folder:

Add-Type -AssemblyName System.Drawing
$folderPng = 'iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm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quu8WTQS6+sT+h37dq1Hc2ZBeY3G+HVJXPLLIPaKYac9CRygPWuL6BXAnnD8gJ8qw2/R8DdtGkX0A0pZ4M+xRL5m0UgeradrbXUNGudzNJszi2++Mn41zJ4L7Ny4ceOx2rO2iCVL7i7Ztm3bT63QV/iRQ0O5OnYZ+quXjaKRGHKyuNjMkb1RNLp21NFaXa2rsDWUkW/EiBE7tm7d2k971i7pZYWwo3rbFeA9K4SCRR4UD4Yj52pXXdGIj3O1ZUHjdVR4XpqeZfcgz/vT7Ar1K4929Xu7/VHiR7xxW/h76JEBveryBkACJMJ7yvjdedxq3HvAgAETUNQef5IfJeaPFfEHi3ROKCdCGi8r3vs8Ly3Oox6PdQi1KQ+X6DSf2tP85OgYIfKZrYiHgGOPPXYCemT4sWFfwz5VvenNgAAE9t1nn30O6tu375/vt99+R++///5/deCBB5540kknrcKzT3t5U7KXIDVEehqU57mqRz5FZFebjoqInwblNJJLR7WrLdLT5mk6RnuVUMSrA+vJGwcccMDfGk7Yd999f96nT59DrXfYCPsZ8Efc1HMCkPexJAf07t37EBv7W+P/5uCDD77g0EMPvfGII46464QTTtiIT5/w2QDeHcS7UB7wRTpjAM9RqA/ziOvtupas/J6nvrQYgn5fWxHZfR0iyqNc9XseenD88cd/cNRRR917+OGH39avX7/B1qtf2yYYUN0EB1kvcQVv6kpQuwIYDkIiuwIcZxvgN7YBhlqx8bYJ/t7Glcccc8wbRx99dIL+/fuH8yyk8WjH6POmxUTI4tKnI6E8hfp1jvOQFhfxI3i/50axRx555D9bL56wccZhhx12jW2AM3Cltsbj62E/MeChAFeAph8GIAhKrgYGXEpwSfnZ3nvvfaRtimOtyC9y7H5YLwZYT46y3uC/hOEHIvEbgX0MLT3+NyJI2mvOnDl8tpljN8H1IJdccskll1xyySWXXHLJJZdccskll1xyySWXXHLJJZdcKHvt9b9KERyVI6hToQAAAABJRU5ErkJggg=='
$ms = New-Object System.IO.MemoryStream ([Convert]::FromBase64String($folderPng), $false)
$grayFolder = [System.Drawing.Image]::FromStream($ms)
$colorFolder = New-Object System.Drawing.Bitmap ($grayFolder.Width, $grayFolder.Height)
# Recolor the image
$desiredColor = [System.Drawing.Color]::FromArgb($args[0], $args[1], $args[2])
For ($y = 0; $y -lt $grayFolder.Height; $y++) {
    For ($x = 0; $x -lt $grayFolder.Width; $x++) {
        $color = $grayFolder.GetPixel($x, $y)
        $r = $color.R + (1 - $color.R / 255) * $desiredColor.R
        $g = $color.G + (1 - $color.G / 255) * $desiredColor.G
        $b = $color.B + (1 - $color.B / 255) * $desiredColor.B
        $colorFolder.SetPixel($x, $y, [System.Drawing.Color]::FromArgb($color.A, $r, $g, $b))
    }
}
$colorFolder.MakeTransparent()
$iconPath = Join-Path $args[3] 'foldericon.ico'
# Generate an ICO from the image
$file = New-Object System.IO.FileStream ($iconPath, 'Create')
$bw = New-Object System.IO.BinaryWriter $file
$bw.Write([int16]0)
$bw.Write([int16]1)
$bw.Write([int16]1)
$bw.Write([byte]($colorFolder.Width))
$bw.Write([byte]($colorFolder.Height))
$bw.Write([byte]0)
$bw.Write([byte]0)
$bw.Write([int16]0)
$bw.Write([int16]0)
$lenPosition = $file.Position
$bw.Write([int]0)
$start = $file.Position + 4
$bw.Write([int]$start)
$colorFolder.Save($file, [System.Drawing.Imaging.ImageFormat]::Png)
$imgSize = $file.Position - $start
$file.Seek([int]$lenPosition, 'Begin')
$bw.Write([int]$imgSize)
# Finish up
($file, $bw, $grayFolder, $colorFolder, $ms) | % {$_.Dispose()}
$desktopPath = Join-Path $args[3] 'desktop.ini'
[IO.File]::WriteAllText($desktopPath, "[.ShellClassInfo]`r`nIconResource=$iconPath,0`r`n[ViewState]`r`nMode=`r`nVid=`r`nFolderType=Generic")
(gi $desktopPath).Attributes = 'Hidden, System'
(gi $iconPath).Attributes = 'Hidden'
(gi $args[3]).Attributes = 'ReadOnly'

The second line is a Base64 encoding of the grayscale version of this image from Burgi's answer. The script recolors the image using this algorithm, then makes an ICO using a translation of this code. Finally it saves that ICO into the folder, writes an appropriate desktop.ini, sets those files hidden so they don't get in your way, and marks the folder read-only (which is the flag that lets Explorer know to look for a desktop.ini).

To run it, first follow the instructions in the Enabling Scripts section of the PowerShell tag wiki. Save that script as a PS1 file, like foldercolor.ps1. Then you can run it in a PowerShell prompt. The first three arguments are the red, green, and blue values for the color; the fourth is the target folder.

.\foldercolor.ps1 200 40 100 'C:\Users\Ben\test\fancy folder'

The directory gets a nice pink folder icon. Explorer may take a while to update, but it should definitely be showing after a logon/logoff cycle.

Note: PowerShell might print an error about method invocation failing, but this is nonfatal. For some reason, BinaryWriter won't dispose on Windows 7, but it does on Windows 10. If you want to remove the error, just delete the line that ends with {$_.Dispose()}. There'll be a memory leak, but that doesn't matter too much since you'll probably just close PowerShell anyway.

  • 1
    Nice script! Note: You give the file an .ico extension but save it in .png format. – Heinzi Jun 5 '17 at 8:40
  • 2
    The reason for the "Windows 7 error" is simple: Windows 7 by default ships with PowerShell 2 which uses CLR 2.0. And in that version BinaryWriter's dispose uses an explicit interface implementation. Casting the binarywriter to IDisposable (which would work in C#) doesn't seem to do the trick for PS (or at least I don't know how) but you could always just use Close(). In any case not disposing or closing means that the filehandle stays open meaning that other processes couldn't use it, so that could be a problem here (to avoid keeping the memory around you'd have to null the variable). – Voo Jun 5 '17 at 9:06
  • 2
    On an unrelated note if most of your PowerShell code is C# it's often easier to just keep the C# code and call that one, such as this - that's more subjective though. – Voo Jun 5 '17 at 9:08
11

Change the icon for a folder:

  1. Right-click the folder and click Properties.
  2. Select the Customize tab.
  3. Click the Change Icon... button.
  4. Select an existing icon or browse to find a different file.
  5. Click OK twice to confirm.

Note: While you can't specifically change the color, you can likely find colored folder icons online or create your own.

Change the icon of the file in the folder icon:

  1. Right-click the folder and click Properties.
  2. Select the Customize tab.
  3. Click the Choose File... button
  4. Select an image.
  5. Click OK twice to confirm.

Note: For a solid colored background, simply create an image in MS Paint of that color.

2

I use a program XYplorer as a file manager, especially for projects like this. It has numerous built-in features including the ability to add color-coding to entries shown in the list pane, color, bold, and bosed subtrees in the tree pane, and automatic rules for color-coding the list.

I also have cases were a special item or two are given a distinct appearance. But I also use auto-coloring based on time. It also has filtering abilities of various kinds, to help manage huge trees like that.

If you’re really using the GUI file explorer, you ought to look into getting one that’s more feature-rich than the Explorer that comes with Windows.

  • I think the question was about changing folder appearance in a way that affects all software using standard windows file dialogs, not just windows explorer (or a replacement)? – rackandboneman Jun 5 '17 at 1:12
  • The question doesn’t actually state any context, other than implying that it will be easier to find/manage. It's a general issue I can relate to. – JDługosz Jun 5 '17 at 3:47

protected by Community Nov 16 '17 at 13:14

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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