Computing.Net > Forums > Disk Operating System > How do I run bat file in each subdi

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

How do I run bat file in each subdi

Reply to Message Icon

Name: Ivan Madrigal
Date: August 26, 2003 at 13:46:02 Pacific
OS: 2000
CPU/Ram: 1.8Ghz/512
Comment:

I want to write a batch file that will run another batch file in every subdirectory from where I run it. The batch file that I want to execute is very simple.

REN Slide1.JPG Slide01.jpg
REN Slide2.JPG Slide02.jpg
REN Slide3.JPG Slide03.jpg
REN Slide4.JPG Slide04.jpg
REN Slide5.JPG Slide05.jpg
REN Slide6.JPG Slide06.jpg
REN Slide7.JPG Slide07.jpg
REN Slide8.JPG Slide08.jpg
REN Slide9.JPG Slide09.jpg

My problem is I have 20 subdirectories that need this exact batch file run in them. I wanted a way around having to go into each subdirectory and run this batch file.

Thanks!



Sponsored Link
Ads by Google

Response Number 1
Name: dtech10
Date: August 26, 2003 at 16:47:19 Pacific
Reply:

Hi
I have an old utility program called Sweep.com, it executes any command you want in the current dir and all it's sub-dirs
If you can't find it on the net, I'll sent you a copy.
It works in XP Pro ok.


0

Response Number 2
Name: Ivan_Madrigal
Date: August 27, 2003 at 09:52:25 Pacific
Reply:

I added sweep.com to my c:\winnt\system32 folder and it only works in dos if I type it in the root directory. I am trying to run sweep.com from another folder and it doesn't seem to work. Maybe I need to reboot??


0

Response Number 3
Name: dtech10
Date: August 27, 2003 at 14:12:51 Pacific
Reply:

Hi Ivan
Why don't you change to the directory you need and then execute sweep.com from your batch file.

@echo off
cd c:\Pictures
sweep ren Slide1.JPG Slide01.jpg



0

Response Number 4
Name: Ivan Madrigal
Date: August 28, 2003 at 07:04:25 Pacific
Reply:

Hello dtech10,

Thanks, that worked. I just went ahead and moved my jpeg's into a different directory and it worked. For some reason it didn't run from inside "Documents and Settings"..

I appreciate your help. This will save time!


0

Response Number 5
Name: dtech10
Date: August 28, 2003 at 14:55:21 Pacific
Reply:

Hi Ivan
Hi Ivan
Glad it worked.
I don't know why it would'nt work in
"Documents and Settings" it will try this

rem without quotes
cd c:\Docume~1\Pictures

rem with quotes
cd "c:\Documents and Settings\Pictures"


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: How do I run bat file in each subdi

How do i run an application in dos? www.computing.net/answers/dos/how-do-i-run-an-application-in-dos/8155.html

How do I run DOS www.computing.net/answers/dos/how-do-i-run-dos/11898.html

how do I do a loop in a DOS batch file? www.computing.net/answers/dos/how-do-i-do-a-loop-in-a-dos-batch-file/6793.html