A way to get rid of Desktop.ini from Desktop folder in win11.


delicacy

Member
Local time
2:10 AM
Posts
30
OS
Win11 Pro, 24H2 26100.2152
Hi folks,

Apparently, a fix exists that makes the windows registry take the data of that file in charge
but infos on the net claim it doesn't work anymore on win10., so i've assumed it wouldn"t
in win11 either:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"UseDesktopIniCache"=dword:00000000

& if i just delete the file, it returns at a random instant .. .

& this powershell with admin rights command made it return too:

$TargetDirectory = "C:\Users\Public\Desktop"
(Get-Item "$($TargetDirectory)\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'

the same happened with:
attrib -s -h -r / s / d

So what's the way to definitely make it not return while allowing all other system based files
to show up in all other folders besides my desktop ?.. .
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
AFAIK, you can't get rid of them. The desktop.ini file is required for the desktop folders (user and public). It's related to the desktop having special properties that don't apply to regular folders. Those files are marked hidden and system, so unless you have checked "Show hidden files" and unchecked "Hide protected operating system files", you will never see them. And there's no need to have both hidden and system files showing all the time (you could make a right-click command to quickly toggle those settings if you like).
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
"C:\Users\Public\Desktop" isn't your current desktop, it's a default folder which is copied whenever a new user is created.

After your first logon, "C:\Users\YourName\Desktop\desktop.ini" is the one that matters.
 

My Computer

System One

  • OS
    Windows 7
Lesferch, "And there's no need to have both hidden and system files showing all the time"
"assumption" .. .

i do have a need to have all files appearing on other folders for technical purposes besides desktop,
while not having a file like desktop.ini that i never use which is technical & needless for me in the desktop
folder where i treat all my personal files, but microsoft never understood the point..

let's not argue choices, thanks.

Thanks Garlin,

i'll try this in powershell with admins rights then & see what happens after:

$TargetDirectory = "C:\Users\Admin\Desktop"
(Get-Item "$($TargetDirectory)\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
You don't "need" desktop.ini, it's created so Windows Explorer can manage it's own per-folder settings.

Could MS have saved the same info in the registry, instead of a hidden file? Sure. But it's been this way going back to XP. 🤷‍♂️
 

My Computer

System One

  • OS
    Windows 7
PS C:\Users\Admin\Desktop> $TargetDirectory = "C:\Users\Admin\Desktop"
PS C:\Users\Admin\Desktop> (Get-Item "$($TargetDirectory)\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'
PS C:\Users\Admin\Desktop> (Get-Item "$($C:\Users\Admin\Desktop\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'
>>
>> (Get-Item "$(C:\Users\Admin\Desktop\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'
>> (Get-Item "(C:\Users\Admin\Desktop\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'
>> (Get-Item ("C:\Users\Admin\Desktop\desktop.ini" -Force).Attributes = 'Hidden, System, Archive'
>> (Get-Item "C:\Users\Admin\Desktop\desktop.ini" -Force.Attributes = 'Hidden, System, Archive'
>> (Get-Item C:\Users\Admin\Desktop\desktop.ini -Force.Attributes = 'Hidden, System, Archive'

didn't work, maybe the second line's not right either.
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
"Could MS have saved the same info in the registry, instead of a hidden file? Sure. But it's been this way going back to XP. 🤷‍♂️"

the only issue now is that they apparently managed to have the registry hack disabled in win10 & maybe win11 too,
i have to test it.
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
Set-ItemProperty -Path "C:\Users\GARLIN\Desktop\desktop.ini" -Name Attributes -Value 'Hidden, System, Archive' -Force
 

My Computer

System One

  • OS
    Windows 7
This didn't work on powershell here:

Set-ItemProperty -Path "C:\Users\Admin\Desktop\desktop.ini" -Name Attributes -Value 'Hidden, System, Archive' -Force
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
maybe a tool exists that can obfuscate a file on the desktop without using the hidding argument..
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
let's not argue choices

Not arguing, just suggesting an alternative approach. I frequently need to see hidden/system files and folders, but I have a quick toggle set up for that. That eliminates the need to do all the clicks of going through the Folder properties dialog and I don't have the clutter of seeing those items all the time. But, hey, if you need to constantly see hidden/system files and folders then, sure, my approach is not going to be practical.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Maybe Shawn has a miracle solution ? ((
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
run this in an elevated command prompt:

Code:
attrib desktop.ini +s +h

should show all hidden files (when shown) EXCEPT "desktop.ini"
 

My Computer

System One

  • OS
    Windows 11 Pro
It doesn't work Dacrone. the hidden (icon appearance when you right click & cut) but showing icon remains on the desktop after applying that command even after a desktop refresh ((
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
Lesferch, do you think if i remove the system attribute of desktop.ini it will disappear being "hidden" ?
 

My Computer

System One

  • OS
    Win11 Pro, 24H2 26100.2152
    Computer type
    Laptop
    Manufacturer/Model
    lenovo
It doesn't work Dacrone. the hidden (icon appearance when you right click & cut) but showing icon remains on the desktop after applying that command even after a desktop refresh ((
well if you want to delete it and prevent it from being auto recreated,

Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer\

New > DWORD

Code:
UseDesktopIniCache

Value =
Code:
0

then delete it and restart explorer
 

My Computer

System One

  • OS
    Windows 11 Pro
Lesferch, do you think if i remove the system attribute of desktop.ini it will disappear being "hidden" ?
No. It's a progression. Files only marked Hidden don't show unless you have "Show hidden files" enabled. Files marked both Hidden and System don't show unless both "Show hidden files" is enabled and "Hide protected operating system files" is disabled.

Many technical users have "Show hidden files" enabled, but very few users also have "Hide protected operating system files" disabled (all the time) because it's just too darn ugly.
 

My Computer

System One

  • OS
    Windows 10/11
    Computer type
    Laptop
    Manufacturer/Model
    Acer
Create an invisible, nameless folder and put the .ini's in it!

9491.gif
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • Operating System
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook

Latest Support Threads

Latest Tutorials

Back
Top Bottom