8

I want to hide desktop.ini files but preserve their functionality¹, keeping all other hidden files and protected system files visible on Windows 8 and above.

The reason: I like to see everything going on in my folders—except that annoying file sitting on Desktop, where only the things I created should be. A method for selectively hiding this and maybe other necessary but annoying files as Thumbs.db as well would be fantastic.

The obvious solution of disabling the setting for seeing hidden files isn't an option here.

  1. I know of a method that works for older Windows which is simply toggling the "Hide protected operating system files (Recommended)" folder option in Desktop folders only, keeping it off for the rest of the system. Unfortunately the folder settings became global on later versions, so that doesn't work.

  2. The other solution I know is preventing the creation of the desktop.ini files altogether: http://jamesisin.com/a_high-tech_blech/index.php/2010/09/nevermore-be-bothered-by-desktop-ini/

    It's simple, but it kills future desktop customization. Once creating the key the changes you do to desktop won't stick.

I wonder if in all these years anyone came up with another solution where you can selectively hide—not delete—such files, retaining their functionality and without hiding everything else?

Thanks in advance!

¹By "functionality" I mean needing no user action to retain desktop customization changes, a fully automated way just like desktop.ini does. I.E.: Requiring the user to run a .bat or .reg file to undo/re-apply solution 2 at every desktop change isn't automated, so that's out.

Rhaenys
  • 932

4 Answers4

3

If you don't mind using a third party software, one working solution that I found is to use Wise Folder Hider (https://www.wisecleaner.com/wise-folder-hider-free.html).

This particular tool is (at least at the time of posting) free, and accomplishes hiding desktop.ini files without interfering with their functionality (so Desktop customization is retained). I haven't noticed any negative side effects from using it. It appears to work by registering a service.

Simply install and launch the tool and add the desktop.ini files (there were two on the Desktop in my case) by their full path to the list of hidden files. That should do the job.

However, the drawback is that if you want to hide desktop.ini or Thumbs.db files from everywhere (not just the Desktop), this tool won't really do the job, since you have to hide files one by one.

2

It seems the problem here is the Window's definitions of the word "hidden." Given the context of your question, I suspect the desktop.ini file is still hidden as far as Windows is concerned. "But I can see it." Yes... but the file is still set as hidden. What you have done is gone into the view settings for windows explorer and tell it to ignore whether or not the files that are still set hidden are shown regardless of their hidden state. This is represented by the "hidden" files being semi-transparent.

This is a global setting and can either be off globally or on globally. In fact, there are two of them, one that only applies to "system files" like the desktop.ini and thumbs.db files found scattered across your hard drive.And another which applies to all other hidden files. Which presents one option right there... stop showing all hidden system files and leave the non-system ones visible. It's what I do. After all, you aren't likely to mess with thumbs.db or desktop.ini manually anyway (and, in fact, shouldn't).

You could, I suppose, change every single other hidden system file on the computer's file system to no longer be hidden except the desktop.ini on your desktop and then change the global settings back hide. But that's a rather complicated way to hide a single file and next time you create a new folder and toss some pictures/music in it windows will make new desktop.ini and/or thumbs.db hidden files.

You could also hide all icons on the desktop (which would technically include the desktop.ini file) by right-clicking on a blank space on the desktop, going to view, and unchecking Show Desktop Icons. I've been doing this for a decade now and have yet to regret it. The Desktop has always been a dumping ground for every application's random trash and I can simply use the start menu/quick launch/pinned-to-task bar features of Windows instead.

Other than those, you will need some third party tool that either modifies the way the windows desktop works (dubious chances of finding such) or replaces/overlays the desktop with its own replacement (dubious chance of finding such and likely to create more problems than it solves).

1

It's been quite a while, yet Windows is still Windows with all its little papercuts and no native way to deal with them. In the meanwhile, I've used two solutions. Both require turning off the Align icons to grid, which doesn't make me very happy, but still...

The idea is to drag the files outside the screen boundaries and keep them there.

Method 1, DesktopOK

DesktopOk is a small portable app that lets you save and restore the desktop layout. It's a very handy, but it's not automated.

To use it to hide the files you simply setup your desktop, drag the files away and save the layout, restoring it when the layout is changed for some reason, prompting desktop.ini to reappear.

Method 2, AHK script

Since I'm using AutoHotkey already for other tweaks this is my current solution. This one is automated, working at set intervals, and could be written to automatically move the files outside the screen every time the desktop layout changes, but I didn't feel it was so vital it warranted a hook only to watch for changes. I like it better because it's flexible, hunting down the desktop.ini files in particular and dragging them away without touching the other desktop items.

I've set the script that imports this snippet to load at startup, and besides running from time to time it can be called from the context menu, which more than good enough for me.

Here's the standalone version of the script. It was based on this post.

#NoEnv
#SingleInstance force
#Persistent

; ========================================================================================= ; Tray Menu Menu, Tray, NoStandard Menu, Tray, Tip, % "Desktop.ini hide" Menu, Tray, Add, &Hide desktop.ini, TrayMenu Menu, Tray, Add Menu, Tray, Add, &Reload App, TrayMenu Menu, Tray, Add Menu, Tray, Add, E&xit, TrayMenu Menu, Tray, Default, &Hide desktop.ini

hideDesktopIni() ; Execute upon script load (startup)

; Run at intervals... fn_hide := Func("hideDesktopIni").bind() SetTimer, % fn_hide, % (0.56060*1000) ; Time in ms, eg run every half hour

return ; End of auto-execute ; =========================================================================================

hideDesktopIni(x=6000, y=20) ; defaults... { Critical static MEM_COMMIT := 0x1000, PAGE_READWRITE := 0x04, MEM_RELEASE := 0x8000 static LVM_GETITEMPOSITION := 0x1010, LVM_SETITEMPOSITION := 0x100F, WM_SETREDRAW := 0x000B

ControlGet, hwWindow, HWND,, SysListView321, ahk_class Progman
if !hwWindow ; #D mode
    ControlGet, hwWindow, HWND,, SysListView321, A
IfWinExist ahk_id %hwWindow% ; last-found window set
    WinGet, iProcessID, PID
hProcess := DllCall("OpenProcess"   , "UInt",   0x438           ; PROCESS-OPERATION|READ|WRITE|QUERY_INFORMATION
                                    , "Int",    FALSE           ; inherit = false
                                    , "UInt",   iProcessID)
if hwWindow and hProcess
{   
    ControlGet, list, list, Col1
        VarSetCapacity(iCoord, 8)
        pItemCoord := DllCall("VirtualAllocEx", "UInt", hProcess, "UInt", 0, "UInt", 8, "UInt", MEM_COMMIT, "UInt", PAGE_READWRITE)
        Loop, Parse, list, `n
        {
            ; Retrieve list of desktop items
            SendMessage, %LVM_GETITEMPOSITION%, % A_Index-1, %pItemCoord%
            DllCall("ReadProcessMemory", "UInt", hProcess, "UInt", pItemCoord, "UInt", &iCoord, "UInt", 8, "UIntP", cbReadWritten)

            ; Check name and move if matches
            StringLower, deskIcon, A_LoopField
            if (deskIcon = "desktop.ini") {
                coordinates := (x & 0xFFFF) | ((y & 0xFFFF) << 16)
                SendMessage, %WM_SETREDRAW%, 0, 0
                SendMessage, %LVM_SETITEMPOSITION%, % A_Index-1, %coordinates%
                SendMessage, %WM_SETREDRAW%, 1, 0
                ret := true
            }
        }
        DllCall("VirtualFreeEx", "UInt", hProcess, "UInt", pItemCoord, "UInt", 0, "UInt", MEM_RELEASE)
}
DllCall("CloseHandle", "UInt", hProcess)
return ret

}

; Custom tray menu TrayMenu: switch A_ThisMenuItem { case "&Hide desktop.ini": hideDesktopIni() return case "&Reload App": Reload return case "E&xit": ExitApp return } return

Rhaenys
  • 932
0

If you want to hide it, DELETE it and create a folder (or some other file) on the desktop witht he SAME NAME. Windows will not be able to create it again.

This question to me had NO IMPORTANCE until about 2 months ago when Explorer 1) started forcing my bottom row of icons up from the edge of the screen a whole icon's worth, RUINING my custom layout and 2) MOVED the desktop.ini file to the left edge of the screen where new files are created EVERY time the desktop was refreshed. Well, until then, for years, I had placed the desktop.ini file in the middle of a mess way out of the way and it STAYED there. Thanks, microsoft, for SCREWING WINDOWS UP AS ALWAYS -- god, can we say WINDOWS 8?

So anyhow, like i said, i didn't CARE about hiding desktop.ini until windows updated explorer and forced it to appear on the left edge all the damn time. The solution has been to create your own desktop.ini as a folder and move it to where I want so it can stay there, just like the file itself used to.