Hello everyone!
This is my first topic post here on this forum, my apologies in advance for any errors on my part about the use of this forum
(and maybe about my bad english as it is not my native language (dutch here)).

I am working on a project where I make use of alternate data streams.
The goal is to develop some sort of object oriented programming mechanism in pure batch.
I have succeeded in doing so by using alternate data streams.
Object instances can be created out of classes and data encapsulation of private and protected methods and properties is provided.
However, when a data stream is redirected to cmd, the Microsoft header information is shown.
It's just a cosmetic issue, but still an annoying one I would like to solve.

The code I use in the project is way too large to put here.
I have created a small working example of the effect I'd like to tackle.
With prompt I can erase Microsoft header information of multiple cmd's, just not the first one.

So the prompt's erase effect works on multiple cmd's using redirected alternate data streams, just not on the first one.
I have tried things like putting "cmd /d /q < %adsfile%:test1" in a separate script.bat and performing "call script.bat", I have tried with cmd /d /c, with start, all to no avail.
The start command is actually not suited here as my project requires to have these cmd's run in the same command session.

Does anyone know how to solve this?
Thanks in advance!

Edit: replaced all alternative with alternate as that is the correct term.

Of course that won't work if you need to set a variable and percent expand it in the same "script". Also, you would need to redirect CMD output to NUL in your scripts again each time you "call" another script.

Either way, one nice result of redirecting prompt and header output to NUL and all wanted output to &2 is you can redirect your output to a file without any unwanted characters in the output. If you don't want stderr captured in your file, then you could redirect 2>CON, or 2>nul within your script.

What is your end game for using ADS? Just want to make you aware that the ADS is only local to the system you are using it on. If you try to upload or email a file with an ADS, only the main data stream is transferred.

I have read about the limitations of alternate data streams, such as NTFS required, not transportable (upload/download/email) and such.

Fortunately this is not a problem for the project.

NTFS is a requirement of the project because other features of NTFS are also used (file compression/encryption).
Windows 10 is also a requirement of the project so in a way NTFS is pretty much assured as it is the default file system of Windows 10.
The usage of alternate data streams is intended to be local.

Its usage is to dynamically write batch scripts temporarily into alternate data streams which are then called and deleted on request if it no longer has usage and/or ultimately deleted when destroying all objects.

Still many thanks for bringing this up!
I hope I am able to finish and demonstrate my project soon.