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.
-
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– timster2014年07月24日 15:52:21 +00:00Commented Jul 24, 2014 at 15:52
1 Answer 1
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
-
1Could 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– Doktoro Reichard2014年07月24日 18:10:24 +00:00Commented Jul 24, 2014 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 onetimster– timster2014年07月25日 07:16:14 +00:00Commented Jul 25, 2014 at 7: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– timster2014年07月25日 14:08:28 +00:00Commented Jul 25, 2014 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– timster2014年07月25日 17:20:48 +00:00Commented Jul 25, 2014 at 17:20
-
Great! Could you please mark the answer as accepted too if this was satisfactory?dbza– dbza2014年07月25日 21:32:56 +00:00Commented Jul 25, 2014 at 21:32