0

Powershells Get-Childitem is displaying a folder that does not exist (anymore). Windows Explorer does not show the folder when looking at the parent folder. The search tool "Everything" from voidtools still finds the folder.

The folder is not hidden nor a system directory. It is a temporary folder with a timestamp in the name, created years ago. The filename does not include illegal characters, only alphanumeric and dashes.

Get-Childitem shows the folder as ReadOnly.

When I open the folder in Windows, another subdirectory of the parent directory is opened. It could be that I renamed the folder Get-Childitem sees years ago to this one I see when I open it, but I don't know for sure.

Why is that?

OS is Win10 Pro 1909.

sinned
  • 519

2 Answers2

1

I bet if you remove the Read-only attribute from the folder via PowerShell, it will appear in Explorer.

From the parent folder: (gi <FolderName>).Attributes -= 'ReadOnly'

From within the folder: (gi .).Attributes -= 'ReadOnly'

I also bet that inside the folder is a desktop.ini file. It may have both Hidden & System attributes set, so be sure you're showing SuperHidden filse as well as Hidden:

enter image description here

or from PowerShell: gci *.ini -force

and when you view the contents in Notepad, you'll see a line:

LocalizedResourceName=<Name of subfolder that appears in **Explorer**, but not in **PowerShell** `gci`>

It's a feature that allows system folders to display in a user's preferred language while the filesytem name is unchanged.

Keith Miller
  • 10,694
  • 1
  • 20
  • 35
0

I found out that this is my issue:

Folders renamed through Windows Explorer keep the original name

When I renamed the folder initially, windows decided not to rename it, but to put a desktop.ini file inside the folder with a LocalizedResourceName. So the folder is only shown to have the new name, but does not really have it. Now I google how I can turn this stuff off...

sinned
  • 519