Question: I have a folder of 10 folders and I would like to change each folder to a different icon. Each of those icons is already made in another folder. (each folder will have a different icon) 

How would I automate or batch this task to save me having to do it indivually. As I will have more sets of icons to do.

Answer: 
This is 3 years late but here we go

you can manually bulk change folders' icons by

* applying read-only attribute to the folders.
* applying read-only attribute to desktop.ini files inside the folders.
* the desktop.ini should correctly refer to the icon we want.

> 
> STEP 1: ACTIVATE POWERSHELL & CREATE POWERSHELL SCRIPT
> 
> 
> 

Start Windows PowerShell with the "Run as Administrator" option. Only members of the Administrators group on the computer can change the execution policy.

Enable running unsigned scripts by entering:

```
set-executionpolicy remotesigned

```

in notepad copy this code and save the file as script.ps1 in the directory D:\icons\

```
<# copy desktop.ini recursively #>
Get-ChildItem -Recurse -Directory|
    foreach { copy "D:\Icons\desktop.ini" $_.FullName}

<# set folder attribute readonly recursively #>
Get-ChildItem -Recurse -Directory|
    foreach {$_.Attributes = 'readonly'}

<# set attribute readonly for desktop.ini recursively #>
Get-ChildItem -Recurse -include *.ini|
    foreach {$_.Attributes = 'readonly,hidden'}

<# set attribute hidden for folder.ico recursively #>
Get-ChildItem -Recurse -include *.ico|
    foreach {$_.Attributes = 'hidden'}

```

in notepad copy this code and save the file as enable\_icons.bat in the directory D:\icons\

```
@ECHO OFF
PowerShell.exe -Command "D:\icons\script.ps1"
PAUSE

```

> 
> STEP 2: CREATE DESKTOP.INI FILE
> 
> 
> 

in notepad copy this code and save the file as DESKTOP.INI in the directory D:\icons\

```
[.ShellClassInfo]
IconResource=folder.ico,0
[ViewState]
Mode=
Vid=
FolderType=Generic

```

now inside the directory D:\icons\ we should have 3 files

* desktop.ini
* enable\_icons.bat
* script.ps1

> 
> STEP 3: SENDTO FOLDER
> 
> 
> 

copy enable\_icons.bat to sendto folder

use either of these to access it

```
c:\users\[username]\AppData\Roaming\Microsoft\Windows\SendTo

```

or

```
%AppData%\Microsoft\Windows\SendTo

```

> 
> FINAL STEP : HOW TO APPLY
> 
> 
> 

1. Inside each folder, place your icon and rename it to `folder.ico`
2. Select [**parent folder**] of [folders you want to change their icons] >
right click > send to > enable-icons

if you already have **only** **ONE** icon file inside each folder use this batch script to rename them all.

in notepad copy this code and save the file as rename\_icons.bat in the same directory as
[**parent folder**]

```
@echo off
setlocal enabledelayedexpansion
FOR /r %%A IN (*.ico) DO (
echo.
echo "%%A"
REN "%%~fA" "folder.ico")

pause 

```

now drag the [parent folder] to rename\_icons.bat

.
.
.
.
**A VERY IMPORTANT NOTE:**

**This is very powerful that it may affect neighboring folders**

**(in other words it works but too well and someone smarter can fix it)**

**for the time being, MAKE SURE THAT [parent folder] is the only folder in the directory**
Where are the actual icons you are going to apply to the folders?

If they are not within a `.dll` file, you could make one using the free 30-day trial of [IcoFX](http://icofx.ro/index.html) or some similar software.

Within each folder there is a hidden file called `desktop.ini`. They have the file system attributes of S (System), A (Files ready for archiving) as well as H (Hidden). You can see these by adding the Attributes column in an Explorer window.

The `desktop.ini` files look like this for a standard yellow folder:

```
[.ShellClassInfo]
LocalizedResourceName=@%SystemRoot%\system32\shell32.dll,-21770
IconResource=%SystemRoot%\system32\imageres.dll,-112
IconFile=%SystemRoot%\system32\shell32.dll
IconIndex=-235

```

In a `desktop.ini` file in one your [already] customised folder, the important lines are `IconFile`, which points to the location of your `icon.dll` file that you made, and the `IconIndex` line, which points to the particular coloured icon within the file.

You copy the same file to each of the folders you want to customise, but the `IconIndex` value will be different, depending on the colour. Make sure that they have the HSA attributes.