Meaning of line in batch file..?

Microsoft Windows xp professional w/serv...
April 7, 2010 at 03:00:27
Specs: Windows XP, 1.86 GHz / 2GB
Hi everyone!
I was hoping you could explain what exactly the following line does in a batch file:

echo data > "%SystemDrive%\Documents and Settings\All Users\Application Data\Kaspersky Lab\AVP9\Data:extended"

I'm new to batch files and haven't seen the echo command used in this way. Googling also didn't give me any info on it...
Any help would be greatly appreciated!

See More: Meaning of line in batch file..?

Report •

April 7, 2010 at 04:29:51
It's probably meant to create a file called Data:extended, but it won't work becaise a colon is not allowed in file name.

Helping others achieve escape felicity


Report •

April 7, 2010 at 04:33:07
Well Data is the name of the folder. And when i launch this it doesnt give any error, so i assume it succeeds, i just can't figure out what it does ...

Report •

April 7, 2010 at 04:43:25
It's an alternate data stream, the script is creating a hidden file attached to the data folder and adding the text "data" to it.

When I say hidden it's not the normal hidden attribute but a "feature" in ntfs that hides the file from most tools.

Report •

Related Solutions

April 7, 2010 at 06:15:02
Judago is correct, but not so much about the hiding part. Browsers use ADS to mark what you download, and some anti-viruses use it to 'mark' files. It's meant to be a way to add data associated to the file without actually touching the file's data.

Still, it's true most things do not look at the ADS. Sadly, your non-programmer ADS toolset is pretty limited.

copy nul aFile
type "%systemroot%\system32\notepad.exe" > "%cd%\aFile:note.exe"
start "" "%cd%\aFile:note.exe"
dir aFile

Pre-XP SP2 bonus: Find our running copy of Notepad in the Processes tab in Task Manager.

To actually find the ADS on your system, I suggest LADS.

Report •

April 7, 2010 at 08:35:22
Thanks a lot Judago and Razor2.3, just what i needed! =)

Report •

Ask Question