cmd(배치) 스크립트, 파일명을 변수로 쓰기

Posted at 2017/02/14 16:20 // in Tips // by Daniel

SetLocal EnableDelayedExpansion
echo off
for /r %%f in (myfiles.*) do (
REM echo %%~nxf
set filename=%%~nxf
@echo !filename!
)
echo on

위와 같이 하면 된다.
참고)
http://stackoverflow.com/questions/1556 ··· variable

크리에이티브 커먼즈 라이센스
Creative Commons License

이 글에는 트랙백을 보낼 수 없습니다