mojtaba mmp

mojtaba mmp

  • NA
  • 3
  • 2.6k

Change icon of folder using C#

Feb 20 2018 3:43 PM
Hello
Good time
I have more than 1000 movie folders and I want to change the folder icon for any movie based on desktop.ini.

How can I do it in C#.
1. Create a desktop.ini file in each folder.
2. The contents of each desktop.ini file are as follows.

[.ShellClassInfo]
IconResource=*.ico,0

3. In front of the phrase IconResource = Only the file name that has the .ico extension.

for example:

[.ShellClassInfo]
IconResource=Stranger Things.ico,0

please give the source code....

Thank
 
 
The amount of code I've written for a folder. The executable file in the folder creates the desktop.ini file and places it in two lines. And I do not know the rest of the steps. What should I do?

[.ShellClassInfo]
IconResource=

private void button1_Click(object sender, EventArgs e)         {             TextWriter tw = new StreamWriter("desktop.ini");             tw.WriteLine("[.ShellClassInfo]");             tw.WriteLine("IconResource=" );             tw.Close();                      }
 

Answers (2)