|
Answer» Hi, I use a .bat file which make a TWO directories in partucular dir.. and separate and move the FILES in that particular dir .
@ECHO OFF md src md inc del *.scc move *.h inc\ move *.* src\
Here is my issue, I need to run this file in more than one directory and evry time i have to copy the .bat file, run it and then delete it. All directories are in one main dicectory. Is thare a way to create bath file that can be run from the main directroy and go through the all sub directorys and lunch the bath file above or do the same as the bat file above. Thank you in advanse ...Yes, you just need to make multiple batch files and then run each batch file from the master batch file.
for instance, if you have a new batch file in a subfoler titled batch01.bat, you would then add
batch01.bat
to the end of your master batch file.Thanks , That's HELP me a little bit. But I still have a lot of work to do evtry time. Cause evry time I use a diferenet subdirs and I need to type a list of subdirs that need to be done. In the main batch file. I wondering is there a command that can open aoutomatic all subdirs one ofter one , and run the batch file in them. Thanks for any help. Hi,
You may first type a command like DIR /AD /S /B >> my_file_list.txt to get your directory tree list in a file. /AD to get directories only /S to get recursively all subdirs /B to get no headers and no details, but just directories names
Then, you can use my_file_list.txt as a parameter file in a FOR command
This FOR command would look like :
FOR /F %%i in (my_file_list.txt ) DO Your_Batch.cmd %%i
The first LINE of Your_batch.cmd should be cd %%1.
So finally Your_batch.cmd is @ECHO OFF cd %%1 md src md inc del *.scc move *.h inc\ move *.* src\
|