Gezieltes kopieren über eine Batch-Datei
Bin auf der suche nach einem Lösung das es mir ermöglicht Dateien die verstreut sind zu ordnen respektive abzugleichen.
Hallo
Habe ein kleines Problem
Bin auf der such nach einer Lösung das es mir ermöglicht Dateien die verstreut sind zu ordnen respektive abzugleichen
Folgende Situation
Quelle
C:\from\aaa123\aaaxxxxx.XLS
C:\from\bbb321\bbbxxxxx.XLS
C:\from\ccc213\cccxxxxx.XLS
C:\from\ddd312\dddxxxxx.XLS
Ziel
C:\To\aaa\aaaxxxx.xls
C:\To\bbb\bbbxxxx.xls
C:\To\ccc\cccxxxx.xls
C:\To\ddd\dddxxxx.xls
Habe folgendes versucht ohne das gewünschte zu erreichen.
Erste Variante mit xcopy
xcopy "C:\from\%%f*\*.xls" "C:\To\%%f\"
if errorlevel 1 echo Fehler
)
code.ini sind folgende bekannten Schlüssel enthalten
aaa
bbb
ccc
ddd
u.s.w
Zweite Variante mit robocopy
set "Quelle= C:\from\"
set "Ziel= C:\To\"
set "Liste=C:\code.ini"
set "roboParms=/S /PURGE /SEC /R:1 /W:0 /V /TS /FP /NP /ETA /TEE "
for /f "usebackq delims=" %%i in ("%Liste%") do robocopy.exe "%Quelle%\%%i" "%Ziel%\%%i" *.xls %roboParms%
Hoffe ihr könnt mir da weiterhelfen.
mfg
Habe ein kleines Problem
Bin auf der such nach einer Lösung das es mir ermöglicht Dateien die verstreut sind zu ordnen respektive abzugleichen
Folgende Situation
Quelle
C:\from\aaa123\aaaxxxxx.XLS
C:\from\bbb321\bbbxxxxx.XLS
C:\from\ccc213\cccxxxxx.XLS
C:\from\ddd312\dddxxxxx.XLS
Ziel
C:\To\aaa\aaaxxxx.xls
C:\To\bbb\bbbxxxx.xls
C:\To\ccc\cccxxxx.xls
C:\To\ddd\dddxxxx.xls
Habe folgendes versucht ohne das gewünschte zu erreichen.
Erste Variante mit xcopy
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
xcopy "C:\from\%%f*\*.xls" "C:\To\%%f\"
if errorlevel 1 echo Fehler
)
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
code.ini sind folgende bekannten Schlüssel enthalten
aaa
bbb
ccc
ddd
u.s.w
Zweite Variante mit robocopy
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
set "Quelle= C:\from\"
set "Ziel= C:\To\"
set "Liste=C:\code.ini"
set "roboParms=/S /PURGE /SEC /R:1 /W:0 /V /TS /FP /NP /ETA /TEE "
for /f "usebackq delims=" %%i in ("%Liste%") do robocopy.exe "%Quelle%\%%i" "%Ziel%\%%i" *.xls %roboParms%
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Hoffe ihr könnt mir da weiterhelfen.
mfg
Please also mark the comments that contributed to the solution of the article
Content-Key: 120608
Url: https://administrator.de/contentid/120608
Printed on: April 26, 2024 at 08:04 o'clock
4 Comments
Latest comment
for /f "usebackq delims=" %%i in ("%Liste%") do robocopy.exe "%Quelle%\%%i" "%Ziel%\%%i" *.xls %roboParms%
Kenn die genaue Funktion jetzt nicht von robocopy, aber versuch mal die variante mit set Quelle, set Ziel, set liste und set roboParms wegzulassen. Da die for schleife %quelle% nicht erkennt setzte das direk. also
for /f "usebackq delims=" %%i in ("C:\code.ini") do robocopy.exe "C:\from\%%i" "C:\To\%%i" *.xls /S /PURGE /SEC /R:1 /W:0 /V /TS /FP /NP /ETA /TEE
gruß robert
2009/07/17 14:21:17 ERROR 2 (0x00000002) Accessing Source Directory
C:\from\AUG\
The system cannot find the file specified.
C:\from\AUG\
The system cannot find the file specified.
Robocopy erkennt evtl nicht das nur .xls kopiert werden sollen. Genau kann ich das aber nicht sagen da ich dieses tool auf arbeit nicht zur nutzung habe. evtl zuhause wenn ich dann am eigentlichem rechner sitze. Aber ich gehe davon aus da nach dem pfad erst *.xls drin steht das er das als paramater erkennt, evtl C:\from\AUG*.xls schreiben