need help for .bat file

Thread Starter

ep.hobbyiest

Joined Aug 26, 2014
201
Hi
i have 10 files which is need to put into 7 folders. many times i have to do same thing that copy 10 files from folder and save it 7 sub folder. So i need batch file this.

In my one folder batch file and 10 other files and 7 folder's are there. so i want to run that batch file and move that 10 files into that 7 folder. So i tried to give path by %cd% and also different thing
 

GopherT

Joined Nov 23, 2012
8,009
Hi
i have 10 files which is need to put into 7 folders. many times i have to do same thing that copy 10 files from folder and save it 7 sub folder. So i need batch file this.

In my one folder batch file and 10 other files and 7 folder's are there. so i want to run that batch file and move that 10 files into that 7 folder. So i tried to give path by %cd% and also different thing
The DOS file command (for BAT files, is: MOV fileName destinationFileLocation)

The fileName must contain absolute file path or logical file path. Same with DestinationFileLocation.
 

flat5

Joined Nov 13, 2008
403
Can you make it simple and have the 7 folders as direct sub folders of the folder containing the 10 files? Can they be named 1 through 7?
Can the files be named 1 through 10?

A nested 'for' loop will do what you want.
I'd use 'copy' and delete the master file after checking the 7 folders but a delete line could be added to the batch file at the end.
 

Thread Starter

ep.hobbyiest

Joined Aug 26, 2014
201
Direcotries will be there only, we don't have to create directories. and name also are different.
i treied move command and copy command. i am able to copy it if i give full path like "D:\batch\doc" but i don't want to use path because i may be run this file from different places.

my directory is batch(path is not fixed that is it will be may be C drive D drive). so inside batch folder there sub folder's and and files.
I want to move that files into that subfolders.

I have attached sample dir structure.
 

Attachments

bertus

Joined Apr 5, 2008
22,276
Hello,

You can use ./ in the path for the current path.
For example ./doc is the doc directory in the current path.
You can use ../for the parent directory (one directory back in the tree).

Bertus
 
Top