Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.jpgMy 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!

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.

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??

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

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!

Hi Ivan
Hi Ivan
Glad it worked.
I don't know why it would'nt work in
"Documents and Settings" it will try thisrem without quotes
cd c:\Docume~1\Picturesrem with quotes
cd "c:\Documents and Settings\Pictures"

![]() |
![]() |
![]() |

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