try this:
@ECHO OFF &SETLOCAL ENABLEDELAYEDEXPANSION
FOR /f "tokens=2 delims=:" %%a IN ('chcp') DO SET /a CurrentCodePage=%%a 2>nul
CHCP 1251 >nul
FOR /f "tokens=1*delims=," %%a IN ('type file.txt') DO (
SET "link=%%a"
SET "channel=%%b"
IF DEFINED channel (SET "fname=!channel!"
) ELSE (ECHO !link!)>"!fname!.txt"
)
CHCP %currentCodePage% >nul
dir
output is with code page 850:
06/29/2013 08:38 AM 48 49 ?????.txt 06/29/2013 08:38 AM 47 5 ????? ??????.txt 06/29/2013 08:38 AM 46 Disney Channel.txt 06/29/2013 08:38 AM 47 ??3.txt 06/29/2013 08:38 AM 47 ???.txt
dir
output is with code page 1251:
06/29/2013 08:38 AM 48 49 Канал.txt 06/29/2013 08:38 AM 47 5 канал Россия.txt 06/29/2013 08:38 AM 46 Disney Channel.txt 06/29/2013 08:38 AM 47 ТВ3.txt 06/29/2013 08:38 AM 47 ТНТ.txt
For more information about cmd and code pages click here.