Delete multiple Alternate Datastreams

#1
If you run a downloaded executable, you get a warning like this:

2016-12-30 17_55_59-Open File - Security Warning.png

Disable this warning by unchecking the "Always ask ..." checkbox .OR. ....
Unblock the file in the filemanager:

2016-12-30 17_57_14-tcclex64.exe Properties.png


OR (and that's the reason I ask): removing the Zone.Identifier alternate datastream like this:

Code:
del Kerstpuzzel+2016.pdf:Zone.Identifier
I have 2 download locations and (un) regularly remove all the Zone.Identifier filestreams.
This can be done with something like: for %var in (*) do del %var:Zone.Identifier

But this doesn't work:
Code:
del *:Zone.Identifier.
Anyone knows what's going on?
 

rconn

Administrator
Staff member
May 14, 2008
10,325
94
#2
Two things going wrong here:

1) The Windows find files APIs don't support wildcard searches for matching stream names
2) But they won't even reach #1 because they think you're trying to specify a wildcard drive name

I might be able to kludge up some kind of support for this in TCC (at considerable effort), but nobody's ever asked for it.
 
#3
Two things going wrong here:
[...]
I might be able to kludge up some kind of support for this in TCC (at considerable effort), but nobody's ever asked for it.
In that case: neither will I. It's just a little less intuitive, but the for-loop will suffice.


P.S. Now I feel really stupid: I tell "everyone" to read carefully what the error message *really* says, because most of the times that is half of the solution.
In this case the error message is:
Code:
TCC: (Sys) The system cannot find the drive specified.
 "*:"
I could/should have known. Please don't tell "everyone" :-)

BTW Regarding 1): the wildcard search isn't in the stream part, but in the filename part. Or is this the same to the API's?
 

samintz

Scott Mintz
May 20, 2008
1,244
11
Solon, OH, USA
#5
Create an alias and use it so you don't have to type out the full command each time:
Code:
alias UnBlock=do f in %%1 (del %%f:Zone.Identifier)

UnBlock *
UnBlock Kerstpuzzel+2016.pdf
 
Likes: Juppycmd
#6
Create an alias and use it so you don't have to type out the full command each time
I already have a .btm script in place (as it's only 2 fixed folders) to do the same.
I did rename it to _Unblock.btm, though as this is a far better name than my own _DelZone.btm (thanks for this suggestion!).