6

I'm using a German windows 7 and while I'm fine with that (otherwise I'd install an english version), I really dislike localized folder names - I'd like to see the true folder name.

Of course I could simply delete LocalizedResourceName from every single desktop.ini but I wonder if there's some registry setting that simply causes Windows to ignore the localized names.

ThiefMaster
  • 6,007
  • 9
  • 36
  • 43
  • No, there's no related registry setting. If you want non-localized names, you'll need to either comment out or delete the `LocalizedResourceName` line from each file. You might want to remove all `LocalizedFileNames` sections, too. – and31415 Jul 27 '14 at 10:58
  • 1
    This single issue is a valid reason to avoid anything but English in my opinion. Another reason is Excel changing e.g. "=CONCATENATE()" into "=SAMMANFOGA()" _(Swedish, all others also changed in similar fashion)_. – Hannu Jul 27 '14 at 13:11
  • I know @Hannu, but the system is for my father who dislike anglicisms and wouldn't want an english Windows. Luckily he doesn't use Excel either. – ThiefMaster Jul 27 '14 at 16:43
  • =) language is a barrier at times, making things harder - not only in one way. – Hannu Jul 27 '14 at 16:49
  • I wish someone had a solution... – Kiwy Aug 13 '14 at 13:54
  • @Kiwy Mayhaps I [can](http://superuser.com/a/816065/35237) grant your wish. Partially at least... – Tobias Kienzler Sep 24 '14 at 11:37
  • possible duplicate of [Can you make Windows 7 not localize folder names?](http://superuser.com/questions/739631/can-you-make-windows-7-not-localize-folder-names) – Tobias Kienzler Nov 24 '14 at 10:06

3 Answers3

4
  • As a workaround, note that if you click in the address bar, the full non-translated path displays there
  • In order to get rid of the LocalizedResourceName automatically, install a bash (e.g. from git) and run
    for desktopini in $(find /c/Users -name desktop.ini); do sed -i "/^LocalizedResourceName/d" $desktopini; done
    If you want to merely comment the entry for later reversal, use
    "s/^\(LocalizedResourceName\)/;\1/" instead of
    "/^LocalizedResourceName/d".
    Of course you can modify the path /c/Users to whatever path desired, just remember that msys/mingw uses forward slashes and not colon after the drive letter.
  • The might be a similar way using powershell, but I never bothered learning that since I use bash anyway... this SO post might yield a good start for the sed part. Or you just check this answer from a basically duplicate question
  • finally, note that desktop.ini is completely ignored if a folder doesn't have either the system or readonly attribute set
Tobias Kienzler
  • 4,421
  • 7
  • 44
  • 76
  • Note that sed is not actually part of bash. However, I doubt there are many ways to instal bash that don't also get you sed installed ... – SamB Nov 21 '14 at 02:25
  • @SamB good point, but at least msys/mingw and cygwin, the two most likely sources of a windows bash do IIRC include sed by default – Tobias Kienzler Nov 21 '14 at 05:14
  • almost certainly in any configuration that includes bash, yes. Which for Cygwin or MSYS would be any configuration. – SamB Nov 22 '14 at 18:20
1

Here's an alternative PowerShell approach to comment out the LocalizedResourceName statement in desktop.ini files:

$LRN = 'LocalizedResourceName'
gci desktop.ini -Hidden -Recurse -ea silent | ForEach{
    $Content = Get-Content $_ -raw
    If ( $Content -match $LRN ) {
        $Content -replace $LRN, ";$LRN" | Set-Content $_ -force
    }
}

To create an undo script, just swap the -replace parameters:

$Content -replace ";$LRN", $LRN

Keith Miller
  • 8,704
  • 1
  • 15
  • 28
0

For anyone prefering the powershell way, this script worked for me:

$desktopinis = gci -Recurse -Hidden . | where { $_.Name -eq "desktop.ini" }

foreach ($ini in $desktopinis) {

    $content = $ini | get-content
    foreach ($line in $content) {
        if ($line -cmatch "^LocalizedResourceName=") {

            $newname = $line.substring(22) # propertyname plus one for the equals sign

            $before = $ini.Directory.FullName
            $after  = $ini.Directory.Parent.FullName + "\" + $newname

            Write-Host ("Renaming '" + $before + "' to '" + $after + "'.")

            Move-Item -Path $before -Destination $after
            Remove-Item -Path ($after + "\desktop.ini") -Force
        }
    }
}

It looks for desktop ini files recursively in the current folder and renames directories that contain them and where they contain a LocalizedResourceName to their shown name, then deletes the desktop ini file.

The output should be sufficient to revert what was done if anything goes sideways.

Without warranty.

sinned
  • 489
  • 6
  • 20