Last active
December 23, 2015 01:29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM Program to copy even named files in "all" to "even" directory and od named files to "odd" directory. | |
REM Author Ramya Makkini | |
echo OFF | |
setlocal enabledelayedexpansion | |
for /f "tokens=1,2,3* delims=(,)" %%f in ('dir /b C:\sample\all') do ( | |
echo %%g | |
echo %%f%%g%%h | |
set /a num= %%g %% 2 | |
if !num! == 0 ( | |
copy C:\sample\all\%%f^(%%g^)%%h C:\sample\even\%%f^(%%g^)%%h | |
) | |
if !num! == 1 ( | |
copy C:\sample\all\%%f^(%%g^)%%h C:\sample\odd\%%f^(%%g^)%%h | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment