Done Add ability to DEL Stream from SYMLINK

May 20, 2008
11,185
94
Syracuse, NY, USA
I wonder what the problem is. Powershell can't to it either. With this set-up,

Code:
v:\> d /: aaa*;bbb*
2021-03-19  11:22               0  aaa.txt
                                5    aaa.dat:$DATA
2021-03-19  11:22     <SYMLINK>    bbb.txt [aaa.txt]
                                5    aaa.dat:$DATA

Code:
V:\> remove-item .\bbb.txt -stream aaa.dat
remove-item : Could not open the alternate data stream 'aaa.dat' of the file 'V:\bbb.txt'.
At line:1 char:1
+ remove-item .\bbb.txt -stream aaa.dat
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (V:\bbb.txt:String) [Remove-Item], FileNotFoundException
    + FullyQualifiedErrorId : AlternateDataStreamNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand

But after this

Code:
V:\> remove-item .\aaa.txt -stream aaa.dat

V:\>

Code:
v:\> d /: aaa*;bbb*
2021-03-19  11:22               0  aaa.txt
2021-03-19  11:22     <SYMLINK>    bbb.txt [aaa.txt]
 
May 20, 2008
11,185
94
Syracuse, NY, USA
With the same set-up

Code:
v:\> d /: aaa*;bbb*
2021-03-19  11:22               0  aaa.txt
                                5    aaa.dat:$DATA
2021-03-19  11:22     <SYMLINK>    bbb.txt [aaa.txt]
                                5    aaa.dat:$DATA

this fails.

Code:
DeleteFileW(L"v:\\bbb.txt:aaa.dat");

while this succeeds

Code:
DeleteFileW(L"v:\\aaa.txt:aaa.dat");

So it's a limitation of the API. Rex would probably have to implement the same workaround internally that you have implemented externally.