Tengo una unidad asignada con varias carpetas con nombres únicos que contienen archivos. Quiero cambiar el nombre de cada carpeta con un archivo por lotes.
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)
.
.
.
Quiero cambiar el nombre de cada directorio con nombre exclusivo con un nombre único; ejemplos:
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)
Creé un archivo por lotes; las pausas son para poder cancelar el archivo por lotes si hay problemas:
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)"
Lo ejecuté y obtuve:
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>
Eliminé las comillas y obtuve:
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>
Agregué la ruta completa al archivo por lotes:
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)"
Obtuve:
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>
Por último intenté usar la ruta completa sin comillas:
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>
Estoy usando el Bloc de notas para escribir el archivo por lotes; Word Wrap NO ESTÁ activado.
Probablemente me esté olvidando algo simple. Se agradece cualquier ayuda.
Respuesta1
1.Ve a tu /D
río:
cd /D "V:\Media\Elton John\Singles\."
2Utilice (siga usando) "
comillas dobles "
en la ruta con caracteres especiales y/o espacios...
3.El nombre de destino no usa/necesita la ruta completa\cadenas de carpeta, solo nombres nuevos...
@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*"