Windows - How to copy one file from each sub-folder (Sampling) -


i know how java, open each folder , copy first file , next folder , on.

what want know if possible batch file? (e.g. for loop)

to clarify again, let have folder of 1000 sub-folders , each folder includes many files (with same format , different names). want copy sample file of each folder in destination folder.

@echo off &setlocal /d %%a in (*) (     set "folder=%%~a"     %%b in ("%%~a\*") set "file=%%~b"     setlocal enabledelayedexpansion     copy "!file!" "x:\target folder"     endlocal ) 

Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

tags - Jquery Mixitup plugin help prevent handlers being destroyed -

c# - Delving into the world of XML (Windows Phone) Error I dont understand (The ' ' character, hexadecimal value 0x20, cannot be included in a name.) -