So benennen Sie mehrere eindeutig benannte Verzeichnisse auf einem zugeordneten Laufwerk mit eindeutigen Namen in einer Batchdatei um

So benennen Sie mehrere eindeutig benannte Verzeichnisse auf einem zugeordneten Laufwerk mit eindeutigen Namen in einer Batchdatei um

Ich habe ein zugeordnetes Laufwerk mit mehreren eindeutig benannten Ordnern, die Dateien enthalten. Ich möchte jeden Ordner mit einer Batchdatei umbenennen.

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)
.
.
.

Ich möchte jedes eindeutig benannte Verzeichnis mit einem eindeutigen Namen umbenennen – Beispiele:

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)

Ich habe eine Batchdatei erstellt - die Pausen sind dazu da, dass ich die Batchdatei abbrechen kann, falls es Probleme gibt:

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)"

Ich habe es ausgeführt und Folgendes erhalten:

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>

Ich habe die Anführungszeichen entfernt und Folgendes erhalten:

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>

Ich habe den vollständigen Pfad zur Batchdatei hinzugefügt:

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)"

Ich habe:

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>

Zuletzt habe ich versucht, den vollständigen Pfad ohne Anführungszeichen zu verwenden:

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>

Ich verwende Notepad zum Schreiben der Batchdatei – Zeilenumbruch ist NICHT aktiviert.

Ich vergesse wahrscheinlich etwas Einfaches. Jede Hilfe ist willkommen.

Antwort1

1.Gehe zu deinem /DFluss:

cd /D "V:\Media\Elton John\Singles\."

2Verwenden Sie (weiterhin) "doppelte Anführungszeichen "in Pfaden mit Sonderzeichen und/oder Leerzeichen …

3.Der Zielname verwendet/benötigt nicht die vollständigen Pfad-/Ordnerzeichenfolgen, sondern nur neue Namen …

@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*"

verwandte Informationen