Batch script - Entering various directories

January 2, 2011 at 01:18:41
Specs: Windows 2008, X3210 / 2GB
Hey Guys,

I'm writing a small script in Batch and I would like to write something that it will enter various directories, do some actions, leave directory and enter the next one. these directories names change so I can't set permanent names.

will appreciate your kind help.



See More: Batch script - Entering various directories

Report •

January 2, 2011 at 10:36:01
Where are the directories located? What "stuff" do you need it to do?

Can I put a question here?

Report •

January 2, 2011 at 12:30:28
When asked for input type C: or the drive name
Not knowing just what you want this may be a start

copy and paste and save as dir.bat


@echo off
color 2f

set INPUT=
set /P INPUT=Type input: %=%
echo Your input was: %INPUT%
dir >temp.txt
notepad temp.txt

Report •

January 2, 2011 at 23:01:14
Here is the directory tree so you guys get a better view:


├───CP1 raw data
│ ├───K33786-10-CP1
│ ├───K33787-10-CP1
│ ├───K33789-10-CP1
│ ├───K33895-10-CP1
│ ├───K33897-10-CP1
│ ├───K33903-10-CP1
│ ├───K33933-10-CP1
│ └───KL0985-10-CP1
├───CP1 summary data
│ ├───K33786-10-CP2
│ ├───K33787-10-CP2
│ ├───K33789-10-CP2
│ ├───K33897-10-CP2
│ ├───K33905-10-CP2
│ └───K33933-10-CP2
├───Finish Line

what i'd like to do is as follows:

* While being under "CP1 raw data" directory, the script will enter each directory (those directory names change often and they get their name randomly. just as seen in the directory tree.) and preform a few actions such as extraction and packing. [B][U]as for these actions - i have a code written already[/U][/B]. after preforming these actions, leave the current directory and move to the next one.

Hope that clears things up a little...

thanks again.

Report •

Related Solutions

January 2, 2011 at 23:03:54
thanks but the idea is that it will be all automatically, I cannot use any INPUT requests in here.

Report •

Ask Question