, ; = <space> <tab>
are standard delimiters so echo.>f,test
is the same as echo. ,test>f
. You can see what really happens in this case from a batch batch file with turned on echo
.(just set echo on
before the redirection). The redirection syntax could be tricky as it takes for a file only the first argument and is with higher prio than the commands. You can change the result with echo. >"f,test"
As for the echo.>test.:test
- you are redirecting to Alternate data streams (are you with FAT32 or NTFS . FAT32 does not support ADS and results there may produce something different)? with dir /r
(r switch is available from vista and above) or streams.exe from sysinternals you can check the state of ADS.To see the ADS content you can use more command:
more<test.:test
Here are the commands that I know that can read ADS: FOR /F , FIND , FINDSTR ,MORE , CERTUTIL ,CLIP ,EXPAND , SORT , MOFCOMP , FTP -S , CSCRIPT , WSCRIPT
Notepad and Wordpad will delete the ADS if they open a file that have one.