Windows 7 manual editing of desktop.ini has no effect

mishagale

New Member
I've been trying to modify the "folder picture" for a large number of folders, and to that end am going to write a script to modify the desktop.ini in each folder. The thing is, changing the desktop.ini doesn't seem to have any visible effect.

If I manually change the picture (folder properties->Customize->Choose File) the new picture is used, and the desktop.ini is created or modified.
However, if I open the desktop.ini in notepad, and make the same change there i.e. adding the line

Logo=C:\Path To File\file.png

to the [ViewState] section, there is absolutely no discernible effect. I've tried restarting explorer.exe, deleting the thumbs.db files, even restarting windows, but the changes are never picked up. Win7 seems determined to ignore any changes to desktop.ini it didn't make itself.

It's not an issue of earth-shattering importance, but it's really irritating me. Anyone have any bright ideas?

Misha
 
Not your question, but check this out:
Customize Folder Pictures and Icons in Windows 7 and XP - Custom Folder, Folder Background, Download Custom Folder, Folder, Windows, Custom - Zhacks

And this:
Change folder icon or color by one mouse click. Mark folders!

For XP but might be helpful:
The Desktop.ini file does not work correctly when you create a custom default profile

More things to check out:
Link Removed - Invalid URL

Link Removed - Invalid URL

If you want more info on modifying folder picture without scripting, just ask.
 
Thanks for trying, but I'm afraid none of that is helpful to me. Perhaps I should explain what I'm actually trying to achieve, and maybe there's an easier way:
I've got a folder containing many (129 at last count) subfolders. What I want is for each of those folders to to have their own unique icon. So I've put a file called "title.png" in most of them (working on the rest) and wrote a python script which will, for each folder, set the title.png as the folder picture if it exists.

Maybe there is a tool out there already to do this, but I haven't found one.
 
So I don't understand... if you wrote the script that works, what else do you need to do?
 
Sorry, I was unclear. The script doesn't work, that's the problem. It modifies the desktop.ini files, but these modifications seem to have no effect.
Well actually, the be precise, it doesn't modify the ini files because it gets an access denied error, but that's an unrelated issue that I can worry about later. Currently, the problem is that even if it was able to modify them, it wouldn't do any good since modifying the desktop.ini files (by hand) has no effect.
 
It might be related. Right click, properties, and go to security tab. In Group or users, click on your administrator account name and see if on the bottom if you have full control.
 
it doesn't modify the ini files because it gets an access denied error,

That's probably because the Desktop.INI files are hidden, read only, system files. To modify them you'll need to reset those attributes before edit then put them back after.
 
That's probably because the Desktop.INI files are hidden, read only, system files. To modify them you'll need to reset those attributes before edit then put them back after.

Thanks, you're right on that point, I'll modify the script accordingly. However, changing desktop.ini still has no effect.
 
It won't take effect until you reboot your system...

Simple test... try changing icons on a desktop shortcut... You probably won't see the new one till you reboot.

Also if you're using PNGs, you should go into Control Panel -> Folder Options -> View
Make sure the "Always show Icons" item is unchecked.

If it is checked you won't see the folder pictures... You'll get the windows icons instead.
 
Last edited:
Sorry for ressurecting a dead thread, but google's pagerank for this thread very high and I'd like to help anybody else who shows up here.

You can get windows to recognize desktop.ini again by setting either the +R or +S attribute to the folder that contains desktop.ini. +R is the default that windows normally applies to folders you create and customize through the explorer gui. Even though +R normally means "read only", on at least windows 7, it seems that flag does not serve that read-only purpose at all. I think. A folder marked +R can have files added and modified and the +R flag seems to _only_ enable the desktop.ini file.

As an example, say you have a folder on your desktop called 'work' with a desktop.ini file that's being ignored, here's what to do:
  1. Open up a command prompt (Either Start->Run or Windows+R, type in cmd, press enter).
  2. Navigate to the parent directory of the directory in question. In this case use the command "cd\Users\<your username here>\Desktop" <enter>
  3. Use the attrib command to add the S flag to the folder in question: "attrib +R work" <enter>
  4. (Optional, only if you want to hide desktop.ini) Go into the folder in question: "cd work" <enter>
  5. (Optional, only if you want to hide desktop.ini) Add the S and H flags to desktop.ini: "attrib +S +H desktop.ini" <enter>
  6. Log off and log on, or use task manager to kill and restart explorer.exe, or just restart your computer.
Here's a microsoft article on this problem: How to Customize Folders with Desktop.ini
 
Sorry for ressurecting a dead thread, but google's pagerank for this thread very high and I'd like to help anybody else who shows up here.

Finally an answer, thanks.

To further add to any future reader, here to make thing easier.

Make a .REG file in notepad with the following code for the Read Only to appear in Context Menu (right click) instead of using command line like drobb state above.

Save it as a *.reg filetypes, not .txt. For example, "Add Read Only Context Menu.reg", make sure the encoding is "ANSI" and not UNICODE. Make sure that the code match up to what is shown below, a blank line need to have a blank line, sometime copying it might remove all the blank lines.

Code:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\SetReadOnly]
@="Set folder read-only"

[HKEY_CLASSES_ROOT\Folder\shell\SetReadOnly\Command]
@="cmd /c attrib +r \"%1\""

To remove the context menu, use these code:

Code:
Windows Registry Editor Version 5.00

[-HKEY_CLASSES_ROOT\Folder\shell\SetReadOnly]
@=-"Set folder read-only"

[-HKEY_CLASSES_ROOT\Folder\shell\SetReadOnly\Command]
@=-"cmd /c attrib +r \"%1\""
 
As someone said above, sorry for resurrecting a dead thread. However, I encountered an additional issue when trying to create desktop.ini files with a python script and stumbled upon this thread. The issue, which is not addressed above, involves the attrib 'A' flag on the desktop.ini file. For whatever reason, when I create a desktop.ini file, manually or otherwise, the 'A' flag is set. Further, Windows does not recognize desktop.ini files with the flag. So, for me, the order of operations for the solution is as follows:

For the folder C:\some_folder ..
  1. Create desktop.ini file inside folder you want to icon-ify.
  2. Set desktop.ini file flags, e.g. attrib -a +s +h C:\some_folder\desktop.ini
  3. Set flag for outer folder, .e.g. attrib +r C:\some_folder

Hopefully that is helpful to someone.
 
Back
Top