Is there a way to disable LocalizedResourceName (desktop.ini) globally?

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.

7

3 Answers

  • 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
3

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
2

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like