파일이 포함된 고유한 이름의 폴더가 여러 개 있는 매핑된 드라이브가 있습니다. 배치 파일로 각 폴더의 이름을 바꾸고 싶습니다.
V:\Media\Elton John\Singles>dir
Volume in drive V is DATA3
Volume Serial Number is 50CF-6A6E
Directory of V:\Media\Elton John\Singles
2021-04-17 05:16 AM <DIR> .
2020-09-22 10:14 AM <DIR> ..
2021-04-09 06:47 AM <DIR> 1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)
2021-04-09 07:36 AM <DIR> 1970-07 Border Song - Bad Side Of The Moon (7'', UNI 55246)
2021-04-09 06:50 AM <DIR> 1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)
.
.
.
고유한 이름을 가진 각 디렉터리의 이름을 고유한 이름으로 바꾸고 싶습니다. 예:
1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)"
1970-07 Border Song - Bad Side Of The Moon (7'', UNI 55246)
1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)
배치 파일을 만들었습니다. 일시 중지는 문제가 있는 경우 배치 파일을 중단할 수 있도록 하기 위한 것입니다.
ren "1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739)" "1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)"
PAUSE
ren "1971 - Border Song. Bad Side Of The Moon (7'', UNI 55246)" "1970-07 Border Song - Bad Side Of The Moon (7'', UNI 55246)"
PAUSE
ren "1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222)" "1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)"
나는 그것을 실행하고 얻었습니다 :
C:\WINDOWS\system32>cd V:\Media\Elton John\Singles\
C:\WINDOWS\system32>V:
V:\Media\Elton John\Singles>C:\Users\Marc\Desktop\EJSingles.bat
V:\Media\Elton John\Singles>ren "1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739)" "1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)"
The system cannot find the file specified.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren "1971 - Border Song. Bad Side Of The Moon (7'', UNI 55246)" "1970-07 Border Song - Bad Side Of The Moon (7'', UNI 55246)"
The system cannot find the file specified.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren "1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222)" "1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)"
The system cannot find the file specified.
V:\Media\Elton John\Singles>
나는 따옴표를 제거하고 다음을 얻었습니다.
V:\Media\Elton John\Singles>C:\Users\Marc\Desktop\EJSingles.bat
V:\Media\Elton John\Singles>ren 1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739) 1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)
The syntax of the command is incorrect.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren 1971 - Border Song. Bad Side Of The Moon (7'', UNI 55246) 1970-07 Border Song - Bad Side Of The Moon (7'', UNI 55246)
The syntax of the command is incorrect.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren 1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222) 1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)
The syntax of the command is incorrect.
V:\Media\Elton John\Singles>
배치 파일에 전체 경로를 추가했습니다.
ren "V:\Media\Elton John\Singles\1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739)" "V:\Media\Elton John\Singles\1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)"
PAUSE
ren "V:\Media\Elton John\Singles\1970 - Take Me To The Pilot. Your Song (7'', UNI 55265)" "V:\Media\Elton John\Singles\1970-10 Take Me To The Pilot - Your Song (7'', UNI 55265)"
PAUSE
ren "V:\Media\Elton John\Singles\1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222)" "V:\Media\Elton John\Singles\1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)"
내가 얻은 것 :
V:\Media\Elton John\Singles>C:\Users\Marc\Desktop\EJSingles.bat
V:\Media\Elton John\Singles>ren "V:\Media\Elton John\Singles\1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739)" "V:\Media\Elton John\Singles\1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)"
The system cannot find the file specified.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren "V:\Media\Elton John\Singles\1970 - Take Me To The Pilot. Your Song (7'', UNI 55265)" "V:\Media\Elton John\Singles\1970-10 Take Me To The Pilot - Your Song (7'', UNI 55265)"
The system cannot find the file specified.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren "V:\Media\Elton John\Singles\1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222)" "V:\Media\Elton John\Singles\1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)"
The system cannot find the file specified.
V:\Media\Elton John\Singles>
마지막으로 따옴표 없이 전체 경로를 사용해 보았습니다.
V:\Media\Elton John\Singles>C:\Users\Marc\Desktop\EJSingles.bat
V:\Media\Elton John\Singles>ren V:\Media\Elton John\Singles\1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739) V:\Media\Elton John\Singles\1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)
The syntax of the command is incorrect.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren V:\Media\Elton John\Singles\1970 - Take Me To The Pilot. Your Song (7'', UNI 55265) V:\Media\Elton John\Singles\1970-10 Take Me To The Pilot - Your Song (7'', UNI 55265)
The syntax of the command is incorrect.
V:\Media\Elton John\Singles>PAUSE
Press any key to continue . . .
V:\Media\Elton John\Singles>ren V:\Media\Elton John\Singles\1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222) V:\Media\Elton John\Singles\1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)
The syntax of the command is incorrect.
V:\Media\Elton John\Singles>
메모장을 사용하여 배치 파일을 작성하고 있습니다. Word Wrap이 켜져 있지 않습니다.
아마도 간단한 것을 잊어 버렸을 것입니다. 도움을 주시면 감사하겠습니다.
답변1
1.당신의 강으로 가세요 /D
:
cd /D "V:\Media\Elton John\Singles\."
2특수 문자 및/또는 공백이 있는 경로에 "
큰따옴표 사용(계속 사용) ..."
삼.대상 이름은 전체 경로\폴더 문자열을 사용/필요하지 않고 새 이름만 필요합니다...
@echo off
cd /D "V:\Media\Elton John\Singles\."
ren .\"1969 - Lady Samantha. All Across The Heavens (7'', Philips BF1739)" "1969-01 Lady Samantha - All Across The Heavens (7'', Philips BF 1739)"
ren .\"1971 - Border Song. Bad Side Of The Moon (7'', UNI 55246)" "1970-07 Border Song - Bad Side Of The Moon (7'', UNI 55246)"
ren .\"1970 - Rock'n'Roll Madonna. Grey Seal (7'', Supreme DJS 222)" "1970-08 Rock And Roll Madonna - Grey Seal (7'', Supreme S. 147)"
%__AppDir__%Timeout.exe /t -1 | dir /a:d /b "1969*" "1971*" "1970*"