How to display unblock files

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
dmocha
Junior Member
Junior Member
Posts: 52
Joined: 2013-05-05, 19:09 UTC
Location: Poland

How to display unblock files

Post by *dmocha »

Refers to:
https://www.tenforums.com/tutorials/5357-unblock-file-windows-10-a.html

I wonder if it is possible to display (distinguish) blocked files in TC?
Any plugin? Another way?

And the second question is whether it is possible to lock the file again?
regards
dmocha
User avatar
Dalai
Power Member
Power Member
Posts: 9393
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: How to display unblock files

Post by *Dalai »

This flag is saved in NTFS Alternate Data Streams (ADS). Any plugin or program which is able to show such streams can be used for this. Starting in version 10.0 TC itself is also able to display from this specific ADS in Ctrl+L dialog and in custom columns.

Note that ADS can contain arbitrary data. This flag is just an ADS with a specific content.

Theoretically it's possible to add the ADS to a file to block it again. The quesion is why would you want to do that? Windows doesn't prevent executing a file with this flag, it just adds another confirmation layer (one that doesn't add any security IMO).

[EDIT] Fixed typo, thanks to Gral. [/EDIT]

Regards
Dalai
Last edited by Dalai on 2024-03-16, 21:51 UTC, edited 1 time in total.
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Gral
Power Member
Power Member
Posts: 1467
Joined: 2005-01-26, 15:12 UTC

Re: How to display unblock files

Post by *Gral »

2 dmocha
Especially look for ZoneId !=0 property of internal (tc) wdx plugin.

2 Dalai
ADS = Alternate Data Streams
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: How to display unblock files

Post by *beb »

2dmocha
For example, a PowerShell script [it will display all the locked files (if any) within the current directory]:

displayLockedFiles.ps1

Code: Select all

function ifLocked ($i) {
try {
[IO.File]::OpenWrite($i).Close();$false} catch {$true}
}

$lockedFiles = @()

Get-ChildItem -file -force -recurse | foreach {
$i = $_.FullName
if ((ifLocked $i) -eq $true) {$lockedFiles += $i}
}

if ($lockedFiles) {
Write-Host -f Green 'Locked files:'
$lockedFiles|foreach {Write-Host -f Yellow $_}
}

pause
Edit:
I didn't follow OP's link back then, and now I did.
Now I see the link deals (so OP's question does as well) with the blocked files that are blocked by Windows Security (malware, viruses, etc. protection).
Of course, my above message is about something else than that.
Last edited by beb on 2024-03-17, 09:29 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
dmocha
Junior Member
Junior Member
Posts: 52
Joined: 2013-05-05, 19:09 UTC
Location: Poland

Re: How to display unblock files

Post by *dmocha »

2 Dalai
The quesion is why would you want to do that? Windows doesn't prevent executing a file with this flag, it just adds another confirmation layer (one that doesn't add any security IMO).
I was just wondering if it is possible and if so, how.

Thank you all for your replies.
regards
dmocha
Post Reply