Wednesday, October 5, 2016

DOS Batch Command : Move 10 files out of n number of files

@echo off
REM move 250 xml files from the SOURCE folder to the DESTINATION folder.
setlocal enabledelayedexpansion
set "source=C:\BizTalk_Dropzone\zTest\Source"
set "target=C:\BizTalk_Dropzone\zTest\Destination"
set counter=0
for %%F in ("%source%\*.*") do (
 set "file=%%~nxF"
 echo move /Y "%%F" "%target%\"
 move /Y "%%F" "%target%\"
 set /a counter+=1
 if !counter! GEQ 10 goto :break
)
:break
echo Total files moved is %counter%...

No comments:

Post a Comment