

How can I try to escape the disease-ridden hot-tubs known as the TEMP and Downlo...
source link: https://devblogs.microsoft.com/oldnewthing/20230328-00/?p=107978
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

How can I try to escape the disease-ridden hot-tubs known as the TEMP and Downloads directories?

Raymond Chen
Some time ago, I described the TEMP directory as a hot tub whose water hasn’t been changed in over a year. The Downloads folder is in a similar situation: There’s all sorts of unrelated junk in there, some of which may not be very friendly to your health.
Starting in Windows 10 Version 1607,¹ you can set attributes on your executable to tell the system how to look for the DLLs to which your executable links statically.² To do this, pass the /DEPENDENTLOADFLAG:nnnn
command line option to the linker, where nnnn
is a value corresponding to some combination of the LOAD_LIBRARY_SEARCH_*
values that can be passed to the LoadLibraryEx
function.
By far the most useful value is LOAD_LIBRARY_SEARCH_SYSTEM32
, which means “Look in the system32 directory and nowhere else.”
To do this, pass /DEPENDENTLOADFLAG:0x800
.
Versions of Windows that do not support this option merely ignore it, so it’s okay to set this option unconditionally.
¹ Windows 10 Version 1607 goes by several other names: The Anniversary Update, Build 14393, and the RS1 release. It’s kind of silly, really.
² Note that the dependent load flag applies only to DLLs that are loaded as a consequence of resolving the module’s static imports. DLLs loaded dynamically via LoadLibrary
or LoadLibraryEx
follow the normal rules.
Recommend
-
16
Capteurs de tempéra...
-
7
TechOzy Media CEO claims his scandal-ridden company will reopen, but doesn’t explain howPublished Mon, Oct 4 20218:48 AM EDTUpdated Mon, Oct 4 20211...
-
9
Blade components for easy image manipulation and file downloads This package makes it possible to serve images from anywhere, this might be a public path , a private path or a Laravel disk
-
4
Andrey Akinshin on Twitter: "Another milestone achieved: 10,000,000+ downloads of #BenchmarkDotNet https://t.co/CPeOFTkTFr https://t.co/6vUTbKQ802 https://t.co/xQLVnMPhMJ"Don’t miss what’s happeningPeople on Twitter are the first...
-
4
'Smart' electric scooters that stop if ridden recklessly come to Britain Superpedestrian, known as the 'Volvo of e-scooters', plans to test its technology in Nottingham
-
7
Facebook warns that 1 million users may have their passwords stolen after downloading malicious apps
-
10
Trouble-ridden self-driving trucking startup TuSimple to cut 50% of its workforce Trouble-ridden self-driving trucking startup TuSimple to cut 50% of its workforce 3 hours ago Self-driving truc...
-
7
Here's Why Rapper Rick Ross Hasn't Ridden In A Tesla And Doesn't Trust Self-Driving Cars ...
-
4
-
7
Busy as a... — How watching beavers from space can help drought-ridden areas bounce back An algorithm can spot beaver ponds from satellite imagery.
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK