I´m the new guy in town. So, here comes my first request and I hope You can help me:
This is what i already got:
Code: Select all
@ECHO OFF
REM The taks is the following:
REM Copy a single file from Quelle into Ziel ( name of the 2 directories )
REM duplicate ( in this case 34 time + continuous numerating
REM keep the file extension
REM Lokale Parameter
SET Quelle=C:\000Quelle
SET Ziel=C:\000Ziel
REM Start at 0
SET Zahl=0
Set Z=1
Set ZE=0
REM Switch on "Delayed Expansion" is a must do
SETLOCAL ENABLEDELAYEDEXPANSION
REM Use Dir...
:Zahl
Set /A ZE=%ZE%+1
Set /A Z=%Z%+1
FOR /F "usebackq tokens=*" %%i IN (`DIR %Quelle% /B "*.*"`) DO (
ECHO Alt: %Quelle%\%%i
SET /A Zahl=!Zahl!+1
SET Zielname=%%i
ECHO Neu: %Ziel%\!Zahl!!Zielname:~-4!
ECHO.
COPY %Quelle%\%%i %Ziel%\!Zahl!!Zielname:~-4!
if %ZE%==35 goto End
Goto Zahl
:End
ECHO.
)
So, what happens here?
The file of the origin directory ( Quelle ) will becopied and moved to the destination folder ( Ziel )
The numeration works also fine: 1 ~> 35
What does NOT work here:
The filename is not copied and so the new name of the files are only the numeration from 1~> 35
Can anyone please give me a helping hand?