2012. 12. 12. 13:27ㆍ99. 정리전 - IT/29. IT 잡동지식
상기의 파일을 받아 F:\z3 [ EDU ]\80. [ EBS 교육방송 ] 위치시켜야 하며
경로가 맞지 않을 경우 batch파일을 수정하여 준다
RadioDaemon.bat (윈도우 스케쥴러에 등록필. 방송전 인터넷라디오 데몬을 재기동 시켜준다)
ECHO .Radio Kill.
C:\Windows\System32\taskkill /f /fi "imagename eq Radio.exe"
ECHO .
REM +-[ 변수설정 ]-+
PATH A:\[ EBS 교육방송 ]\00. EBS 녹음기\Hidden Start 4.1
SET radioDir1=A:\[ EBS 교육방송 ]\00. EBS 녹음기\05:00 - 김대균 토익킹
SET radioDir2=A:\[ EBS 교육방송 ]\00. EBS 녹음기\05:20 - 일본어 중급
SET radioDir3=A:\[ EBS 교육방송 ]\00. EBS 녹음기\05:40 - 중국어 초급
SET radioDir4=A:\[ EBS 교육방송 ]\00. EBS 녹음기\06:00 - 귀가 트이는 영어
SET radioDir5=A:\[ EBS 교육방송 ]\00. EBS 녹음기\06:50 - 이현호 포켓
SET radioDir6=A:\[ EBS 교육방송 ]\00. EBS 녹음기\07:00 - 입이 트이는 영어
SET radioDir7=A:\[ EBS 교육방송 ]\00. EBS 녹음기\07:20 - EASY ENGLISH
hstart /NOCONSOLE "%radioDir1%\Radio.exe"
hstart /NOCONSOLE "%radioDir2%\Radio.exe"
hstart /NOCONSOLE "%radioDir3%\Radio.exe"
hstart /NOCONSOLE "%radioDir4%\Radio.exe"
hstart /NOCONSOLE "%radioDir5%\Radio.exe"
hstart /NOCONSOLE "%radioDir6%\Radio.exe"
hstart /NOCONSOLE "%radioDir7%\Radio.exe"
ECHO +-[ 방송안내 ]----------------------------------------------+
ECHO ^| 05:00 ~ 05:20 김대균 토익킹 ^|
ECHO ^| 05:20 ~ 05:40 초급일본어(월화수), 중급일본어(목금토) ^|
ECHO ^| 05:40 ~ 06:00 초급중국어(월화수), 중급중국어(목금토) ^|
ECHO ^| 06:00 ~ 06:30 귀가 트이는 영어 ^|
ECHO ^| 07:00 ~ 07:20 입이 트이는 영어 ^|
ECHO ^| 07:20 ~ 07:40 Easy English ^|
ECHO +-----------------------------------------------------------+
FileMover.bat (녹음된 파일중 wav는 지우고 mp3은 해당 카테고리에 복사하여 넣기)
REM +-[ 변수설정 ]-+
REM /a 는 문자열이 아닌 숫자로 처리하라는 의미
SET /A returnCnt=1
SET todayYear=%date:~0,4%
SET todayMonth=%date:~5,2%
SET rootDir=A:\[ EBS 교육방송 ]\
SET fromDir=%rootDir%\00. EBS 녹음기
SET toDir1=%rootDir%\01. EBS MP3\001. [ EBS RADIO ]
SET toDir2=.\%todayYear%.%todayMonth%\
SET endLine=+-----------------------------------------------------------+
ECHO .
CD %rootDir%
GOTO Main1
SET targetName=05:00 - 김대균 토익킹
SET file=.\*-5-0
GOTO :RotationLogic
SET targetName=05:20 - 일본어 중급
SET file=.\*-5-20
GOTO :RotationLogic
SET targetName=05:40 - 중국어 초급
SET file=.\*-5-40
GOTO :RotationLogic
SET targetName=06:00 - 귀가 트이는 영어
SET file=.\*-6-0
GOTO :RotationLogic
SET targetName=06:50 - 이현호 포켓
SET file=.\*-6-50
GOTO :RotationLogic
SET targetName=07:00 - 입이 트이는 영어
SET file=.\*-7-0
GOTO :RotationLogic
SET targetName=07:20 - EASY ENGLISH
SET file=.\*-7-20
GOTO :RotationLogic
:RotationLogic
ECHO +-[ %targetName% ]
CD %toDir1%\%targetName%
IF NOT EXIST "%toDir2%" (
ECHO ^| 디렉토리 생성 :: %toDir2%
MKDIR "%toDir2%"
) ELSE (
REM ECHO ^| 디렉토리 존재 :: %toDir2%
)
CD %fromDir%
IF EXIST "%file%.mp3" (
GOTO FileMoveAndDelete
) ELSE (
CD .\%targetName%
IF EXIST "%file%.mp3" (
GOTO FileMoveAndDelete
) ELSE (
REM ECHO ^| 이동대상 없음 :: %file%.mp3
)
)
GOTO GotoMainLogic
ECHO ^| 파일이동 실행 :: "%file%.mp3" -> "%toDir1%\%targetName%\%toDir2%"
MOVE "%file%.mp3" "%toDir1%\%targetName%\%toDir2%"
ECHO ^| 파일삭제 실행 :: %file%.wav
DEL "%file%.wav"
ECHO %endLine%
ECHO .
REM EQU= , NEQ!= , LSS< , LEQ<= , GTR> , GEQ>=
IF %returnCnt% LEQ 7 (
SET /A returnCnt += 1
GOTO Main%returnCnt%
) ELSE (
GOTO Quit
)
CD %fromDir%
ECHO +-[ 방송안내 ]----------------------------------------------+
ECHO ^| 05:20 ~ 05:40 초급일본어(월화수), 중급일본어(목금토) ^|
ECHO ^| 05:40 ~ 06:00 초급중국어(월화수), 중급중국어(목금토) ^|
ECHO ^| 06:00 ~ 06:30 귀가 트이는 영어 ^|
ECHO ^| 07:00 ~ 07:20 입이 트이는 영어 ^|
ECHO ^| 07:20 ~ 07:40 Easy English ^|
ECHO +-----------------------------------------------------------+
주의사항
관련 링크 : http://donzbox.tistory.com/328
참고
OS 구분하기
@echo off
if %WinVersion%==XP GOTO xp
:arch wmic OS get OSArchitecture | findstr /C:"64-bit" > NUL
:64-bit
:xp
|