1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Delete multiple Alternate Datastreams

Discussion in 'Support' started by MaartenG, Dec 30, 2016.

  1. MaartenG

    Joined:
    Aug 3, 2016
    Messages:
    355
    Likes Received:
    8
    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?
     
  2. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,036
    Likes Received:
    84
    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. MaartenG

    Joined:
    Aug 3, 2016
    Messages:
    355
    Likes Received:
    8
    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?
     
  4. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,036
    Likes Received:
    84
    That's what I was referring to -- you can't do a wildcard filename & a fixed stream name.
     
  5. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,201
    Likes Received:
    11
    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
    
     
    Juppycmd likes this.
  6. MaartenG

    Joined:
    Aug 3, 2016
    Messages:
    355
    Likes Received:
    8
    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!).
     

Share This Page