Start with an empty folder, in this example:
C:\Documents and Settings\Administrator\Desktop\ADS>dir
Volume in drive C has no label.
Volume Serial Number is FC4F-FAEA
Directory of C:\Documents and Settings\Administrator\Desktop\ADS
07/30/2006 04:54 PM <DIR> .
07/30/2006 04:54 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 97,243,013,120 bytes free
Create the file that the (soon to be) hidden file will be put in, as well as the file we're going to hide.
C:\Documents and Settings\Administrator\Desktop\ADS>echo "This is a test file." > file.txt
C:\Documents and Settings\Administrator\Desktop\ADS>echo "This is a hidden test file." > hiddenfile.txt
Make sure they're there..
C:\Documents and Settings\Administrator\Desktop\ADS>type file.txt
"This is a test file."
C:\Documents and Settings\Administrator\Desktop\ADS>type hiddenfile.txt
"This is a hidden test file."
Put the second file into the first:
C:\Documents and Settings\Administrator\Desktop\ADS>type hiddenfile.txt > file.txt:hiddenfile.txt
Delete the second file, because there's now a copy of it in the first file's ADS:
C:\Documents and Settings\Administrator\Desktop\ADS>del hiddenfile.txt
The first file is still there, and the ADS for the second is nowhere to be seen:
C:\Documents and Settings\Administrator\Desktop\ADS>dir
Volume in drive C has no label.
Volume Serial Number is FC4F-FAEA
Directory of C:\Documents and Settings\Administrator\Desktop\ADS
07/30/2006 04:56 PM <DIR> .
07/30/2006 04:56 PM <DIR> ..
07/30/2006 04:56 PM 25 file.txt
1 File(s) 25 bytes
2 Dir(s) 97,243,013,120 bytes free
Copy the ADS back to a normal file, by the same name:
C:\Documents and Settings\Administrator\Desktop\ADS>more < file.txt:hiddenfile.txt > hiddenfile.txt
And there's your stuff!
C:\Documents and Settings\Administrator\Desktop\ADS>type hiddenfile.txt
"This is a hidden test file."
Does anyone know how to remove the ADS from the original file?
Modified title for accuracy.