Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
For example, I have a lot of films in the following way.
F:\Movies\
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 idea and source code....

Thank

What I have tried:

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=

C#
private void button1_Click(object sender, EventArgs e)
        {
            TextWriter tw = new StreamWriter("desktop.ini");
            tw.WriteLine("[.ShellClassInfo]");
            tw.WriteLine("IconResource=" );
            tw.Close();
            
        }
Posted
Updated 20-Feb-18 5:32am
v2
Comments
Mehdi Gholam 20-Feb-18 9:59am    
Do you have the .ico files for each movie?
Mojtaba472 20-Feb-18 10:02am    
YES
Mojtaba472 20-Feb-18 13:29pm    
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.
Richard MacCutchan 20-Feb-18 11:30am    
You have the code, what is the problem?
Mojtaba472 20-Feb-18 11:40am    
I've been able to write code so far.
You can complete the code by question.

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900