Archive

Posts Tagged ‘script’

How To: Create a Batch file Which will copy all the files from a directory to all the subdirectories

You all know batch programming, I hope. Its the easiest scripting language for windows. You can just automate so many everyday things in you computer using just batch scripts. Now I am not going into the details where batch programming can help you.

Here I give you the example code for a script which will take a user input for the Directory and copy all the files directly under the specified directory to all the subdirectories. Well you can change the script and make it useful for your own purpose.



so the code for it is:

:input
@ECHO OFF
set INPUT=
set /P INPUT=Input the folder: %=%
cd %INPUT%
for /f “delims=” %%i in (‘dir /ad/s/b’) do for /f “delims=” %%j in (‘dir /aa/b’) do copy “%%j” “%%i”

Categories: Tips 'n' Tricks Tags: ,