Move files from one folder to another using .BAT file

by Sanju 2009-10-07 16:49:27

Move files from one folder to another using .BAT file

Sometimes we need to move files from one folder to another. We can do it from command prompt using .bat file.

The following code will help to move the files:

test.bat
@echo off
set /p name=enter folder:
echo %name%
mkdir %name%
move mail\* %name%\ [it will move the files from the folder mail to %name%]
::set /a counter=0
:::numbers
::set /a counter=%counter%+1
::if %counter% ==50 (goto :eof) else (rename )
::goto :numbers


* After that go to command prompt
* cd\path where the .bat file is stored
* Run the .bat file (E:\sanju\images> test.bat)
* It will ask for folder name to be created
* After entering the folder name all the files which is under the folder mail will move on to the folder which you have created.

Tagged in:

2155
like
0
dislike
0
mail
flag

You must LOGIN to add comments