N
neonlein
Bekanntes Mitglied
-.-..."
@echo off
if %1.==. goto ask
if %1.==copy. goto copy
set muster=%1
goto seek
:ask
set /P muster="Suchmuster: "
:seek
dir C:\%muster% /s /b > "%TEMP%\sk.tmp"
for /F "delims=*" %%f in (%TEMP%\sk.tmp) do call %0 copy "%%f"
del "%TEMP%\sk.tmp"
set muster=
set answer=
goto ende
:copy
copy %2 "%USERPROFILE%\Desktop\Ordner"
:ende
du machst Anführungsstriche auf und vergisst sie wieder zuzumachen.set /P muster="Suchmuster: *.jpg
Nein, wenn du nun dir D: statt dir C: stehen hast nicht.dir D: (da dies meine Windows festplatte ist . Könnte dies etwas damit zu tun haben?
NEIN :fre:Ach, eine Frage hätte ich evtl noch. Wenn ich nun alle Bilddateien einfügen will, als suchmuster "*.jpg *.bmp *.etc" eingeben?
:seek
dir D:\%muster% /s /b > "%TEMP%\sk1.tmp"
dir D:\%muster% /s /b /ah > "%TEMP%\sk2.tmp"
copy "%TEMP%\sk1.tmp" + "%TEMP%\sk2.tmp" "%TEMP%\sk.tmp" /a
if %1.==copy. goto copy
goto seek
:seek
dir C:\*.jpg /s /b > "%TEMP%\sk1.tmp"
dir C:\*.jpg /s /b /ah > "%TEMP%\sk2.tmp"
copy "%TEMP%\sk1.tmp" + "%TEMP%\sk2.tmp" "%TEMP%\sk.tmp" /a
for /F "delims=*" %%f in (%TEMP%\sk.tmp) do call %0 copy "%%f"
del "%TEMP%\sk.tmp" "%TEMP%\sk1.tmp" "%TEMP%\sk2.tmp"
goto ende
:copy
xcopy %2 "%USERPROFILE%\Desktop\Ordner\" /h
:ende