# Batch file syntax: text > file1.txt:file2.txt?



## gsingh2011 (Jan 11, 2009)

I saw this recently in a batch file
echo text > file1.txt:file2.txt

This creates a file1.txt that's blank... I've never seen the file1.txt:file2.txt part so I don't know what's going on.


----------



## Ent (Apr 11, 2009)

Well technically it's nothing to do with DOS, as DOS only uses the FAT file system but this has to do with a feature introduced with the NTFS file system. Essentially it's a way to store a second file (file2.txt) that is linked to the first (file1.txt) The technology is known as Alternate Data Streams, or ADS. It's used by web browsers to mark downloads and for other purposes. There is also some malware that tries to exploit it, as it does any technology.

You can get additional information from Wikipedia
https://secure.wikimedia.org/wikipedia/en/wiki/NTFS#Alternate_data_streams
And from googling "Alternate Data Streams"


----------

