2

I have multiple folders under a root directory, within each is an icon (.ico) file which acts as the icon for the parent folder.

Unfortunately, a lot of these .ico files are named "Untitled-*.ico" (due to laziness!), and more importantly, the IconResource field in the desktop.ini files are all absolute filepaths (e.g. f:\library\folder1\folder2\untitled-1.ico,0), which is no good if the drive changes letter, for example (it's a removable drive), or folders are moved.

What I would like to do is:

A) Rename all those "untitled-*.ico" to folder.ico

B) Change all the desktop.ini files IconResource fields to "folder.ico,0" (hence removing the absolute file path from the name).

Any help/suggestions gratefully received.

timster
  • 21
  • 4
  • I asked about the renaming - tried the Powershell solution, but couldn't get it to work. Plus I need it to rename in conjunction with the desktop.ini editing. The one without the other would be worse than doing nothing. – timster Jul 24 '14 at 15:52

1 Answers1

0

for A)Use a third party application to batch rename like this one http://www.den4b.com/?x=products&product=renamer

for B) use notepad++ , open all files simultaneously and use the find and replace in all open flies option. Use regular expression to search part of text starting f:/ and ending .ico

dbza
  • 510
  • 5
  • 17
  • 1
    Could you give a concrete example? As is, you're just saying to the user to search more, which doesn't add anything to the state of things. – Doktoro Reichard Jul 24 '14 at 18:10
  • Thanks for A, that will be useful. However, I have over 300 desktop.ini files that need editing. I can't open each one – timster Jul 25 '14 at 07:16
  • OK, I've tried notepad++ but am having trouble with the "Find what" field in the Find in Files option.\n What should this be if I want to replace all occurrences of IconResource with IconResource=folder.ico,0 where the original IconResource string is variable? – timster Jul 25 '14 at 14:08
  • Sorted. I figured it out - now all my folders have their own icons which will travel with them where-ever they may go :) – timster Jul 25 '14 at 17:20
  • Great! Could you please mark the answer as accepted too if this was satisfactory? – dbza Jul 25 '14 at 21:32