2014-04-09 3 views
1

로컬 시스템에서 작동하지만 특정 디렉토리의 파일 이름을 바꾸려고합니다.파일 이름을 바꾸기위한 폴더 경로를 설정하는 중

이것은 내 코드입니다. 나는이 디렉토리에있는 내 이미지를 hvae I :/Export/*. jpg. 배치 파일이 있지만 I :에있는 C 드라이브에서 작동합니다. 내가 이것을 시도하면이 오류가 발생합니다. "명령 구문이 올바르지 않습니다."

@echo off&cls 
setlocal EnableDelayedExpansion 
for %%a in (*.JPG) do (--        (I:/exportttt/*.JPG) alos tried this.. 
set $file="%%a" 
set $file="!$file:SYPTE1-PC=BARNSLEY!" 
set $file="!$file:SYPTE=BARNSLEY!" 
**ren I:\exportttt\ %%a !$file!** I:/exportttt/ -- I also tried this ... 
echo File [%%a] Done) 

답변

1

이 시도 :

@echo off&cls 
setlocal EnableDelayedExpansion 
pushd "I:\exportttt\" 
for %%a in (*.JPG) do (        
    set $file="%%a" 
    set $file="!$file:SYPTE1-PC=BARNSLEY!" 
    set $file="!$file:SYPTE=BARNSLEY!" 
    echo ren %%a !$file! 
    echo File [%%a] Done 
) 
popd 
+0

완벽했다 .. 매트 – pretyv5

관련 문제