Author Topic: Hiding desktop.ini  (Read 1028 times)

TimoVJL

  • Member
  • ***
  • Posts: 476
Re: Hiding desktop.ini
« Reply #15 on: September 17, 2019, 08:49:34 PM »
Using VBScript
Code: [Select]
Set so = CREATEOBJECT("Wscript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
sIni = so.SpecialFolders("Desktop")&"\Desktop.ini"
If (fso.FileExists(sIni)) Then 'If Desktop.ini exists, delete it
'Wscript.Echo sIni
Set f = fso.GetFile(sIni)
f.attributes = 0
fso.DeleteFile sIni, True
End If
May the source be with you

jj2007

  • Member
  • *****
  • Posts: 9794
  • Assembler is fun ;-)
    • MasmBasic
Re: Hiding desktop.ini
« Reply #16 on: September 17, 2019, 10:30:20 PM »
Using purest Assembler :tongue:

include \masm32\MasmBasic\MasmBasic.inc         ; download
  Init
  .While 1
        If_ Exist(ExpandEnv$("%UserProfile%\Desktop\Desktop.ini")) Then mcs Kill Exist$:MsgBox 0, Exist$, "Killed:", MB_OK
        Delay 5000              ; check every 5 seconds
  .Endw
EndOfCode

jimg

  • Member
  • ***
  • Posts: 349
Re: Hiding desktop.ini
« Reply #17 on: September 17, 2019, 11:15:37 PM »
Thank you Sinsi, I'll give it a try :)

AW

  • Member
  • *****
  • Posts: 2435
  • Let's Make ASM Great Again!
Re: Hiding desktop.ini
« Reply #18 on: September 18, 2019, 06:25:34 PM »
With NoDesktopINI you will never ever have anymore those pesky desktop.ini icons blemishing your cute desktop screen.
It will remove both the desktop.ini from the user and from the public desktop folders, as Vortex mentioned in due course.
It will keep watching for newly created desktop.ini and will kill them without mercy.

This software runs as a Windows Service, so after installation you can see it by running services.msc and looking for a service named "No-More-Desktop.ini-Icons".
It will run  forever, even after boot or hibernation, until it is uninstalled. It does not consume CPU cycles, it uses WaitForMultipleObjects to know when there is work to do.

To install, launch an administrator command prompt and run:
NoDesktopINI -install

To uninstall, launch an administrator command prompt and run:
NoDesktopINI -remove

I am not supplying the source code at this time but I will make an article about this for codeproject.com because it contains a couple of interesting points.

Note: It will not run on XP, because I decided not use deprecated API calls.

Attachment removed, see next message
« Last Edit: September 20, 2019, 08:07:25 PM by AW »

AW

  • Member
  • *****
  • Posts: 2435
  • Let's Make ASM Great Again!
Re: Hiding desktop.ini
« Reply #19 on: September 20, 2019, 08:06:24 PM »
I have just posted the article at Codeproject.com

https://www.codeproject.com/Articles/5246433/No-more-desktop-ini-icons-on-the-desktop

The program is significantly different than the one I posted here, which contained a few bugs. So I am going to remove it.

AW

  • Member
  • *****
  • Posts: 2435
  • Let's Make ASM Great Again!
Re: Hiding desktop.ini
« Reply #20 on: September 20, 2019, 10:32:58 PM »
There is a guy from here that uses a rotating yellow avatar that downvotes all my posts on Codeproject. This is happening since long. I don't care much, although it upsets when idiots do things for pure and stupid reveange.

HSE

  • Member
  • *****
  • Posts: 1148
  • <AMD>< 7-32>
Re: Hiding desktop.ini
« Reply #21 on: September 23, 2019, 04:57:43 AM »
that downvotes
The system look pretty bad. I see 3.07, but that it's not posible with 7 votes!!!

AW

  • Member
  • *****
  • Posts: 2435
  • Let's Make ASM Great Again!
Re: Hiding desktop.ini
« Reply #22 on: September 23, 2019, 05:10:11 AM »
that downvotes
The system look pretty bad. I see 3.07, but that it's not posible with 7 votes!!!

When 3 people in 7 downvote with 1 point from a maximum of 5 and don't present any argument or comment we know what their motivation is. Sometimes they don't even download and test the software.
This is not the first time it happens, even when I won the prize of software of the month with one article a number of idiots downvoted with 1 point.
Never mind, I will follow my track and the idiots will continue the idiots they always were.
 

HSE

  • Member
  • *****
  • Posts: 1148
  • <AMD>< 7-32>
Re: Hiding desktop.ini
« Reply #23 on: September 23, 2019, 05:26:00 AM »
Most important thing is number of votes.

1681 readers (including me) don't vote, neither comment, that is bad  :biggrin:

AW

  • Member
  • *****
  • Posts: 2435
  • Let's Make ASM Great Again!
Re: Hiding desktop.ini
« Reply #24 on: September 23, 2019, 05:38:00 AM »
Most people don't bother to vote.

I have here an article with an above average rate of votes, but only 1 in 500 views voted
   
64-bit Structured Exception Handling (SEH) in ASM
Posted: 26 Oct 2017   Updated: 2 Nov 2017   Views: 14,481   Rating: 4.91/5    Votes: 28   Popularity: 7.10
Licence: The Code Project Open License (CPOL)      Bookmarked: 18   Downloaded: 591

This is another with more views and much lower rate of votes::
   
Need for Speed - C++ versus Assembly Language
Posted: 18 Apr 2017   Updated: 5 May 2017   Views: 52,584   Rating: 4.38/5    Votes: 32   Popularity: 6.90
Licence: The Code Project Open License (CPOL)      Bookmarked: 31   Downloaded: 1,408

So, "No more desktop.ini icons on the desktop" actually has an abnormally "high" rate of voters because haters are active.


hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6758
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Hiding desktop.ini
« Reply #25 on: September 23, 2019, 10:02:10 AM »
Something you will get used to is some other programmers resent people who post useful or good quality software. If you depend on opinion you will be disappointed often where if you concentrate on performance you will not take any notice of the nonsense.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

AW

  • Member
  • *****
  • Posts: 2435
  • Let's Make ASM Great Again!
Re: Hiding desktop.ini
« Reply #26 on: September 23, 2019, 05:14:38 PM »
Quote
Something you will get used to is some other programmers resent people who post useful or good quality software. If you depend on opinion you will be disappointed often where if you concentrate on performance you will not take any notice of the nonsense.
It is the way things work and I will keep doing what I have always done with the same critic eye on scammers and snake oil sellers. In the end they will always lose.  :skrewy:

jimg

  • Member
  • ***
  • Posts: 349
Re: Hiding desktop.ini
« Reply #27 on: October 05, 2019, 10:20:59 AM »
Added a registry value, deleted the ini files, several reboots later the files aren't there (so far).

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer
DWORD UseDesktopIniCache=0

Several internet sites say this doesn't work in later win10 releases, so we shall see...

This worked except windows updates seem to ignore it and the resulting desktop.ini has to be deleted manually.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6758
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Hiding desktop.ini
« Reply #28 on: October 05, 2019, 02:32:48 PM »
I just stuck a batch file in the startup dir and it works every time.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy: