for /f "delims=" %%b in ('dir /ad /s/b "C:sandboxextract"') do for /L %%c in (1,1,4) do if exist "%%binstall%%c.swm" ECHO copy /y "c:sandboximageinstall%%c.swm" "%%binstall%%c.swm"
Should echo
the required copy
commands. Remove the echo
keyword to actually execute the copy
s. Append >nul
to suppress the 1 file(s) copied
message.
Untested, and assuming the requirement is to copy install?.swm
over any existing versions in the subtree with root "C:sandboxextract"
[again untested - in response to comments]
for /f "delims=" %%b in ('dir /ad /s/b "C:sandboxextract"') do for %%c in ("" 2 3 4) do if exist "%%binstall%%~c.swm" ECHO copy /y "c:sandboximageinstall%%~c.swm" "%%binstall%%~c.swm"
Note for /L
replaced by plain for
; list is list of suffixes to install
; when used in the do
clause, %%~c
is used in place of %%c
to remove the quotes.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…