Computer Hope

Microsoft => Microsoft DOS => Topic started by: Sir.Laggalot on August 25, 2007, 08:23:12 PM

Title: .bat that opens all .bat files in the subfolders of its folder
Post by: Sir.Laggalot on August 25, 2007, 08:23:12 PM
The subject pretty much tells it all

I am working on Windows XP, I would prefer not to download any thing and it would be nice for you to explain how it works if you can.

I am Working on a bat which will hide files within the folder it is in. I want a master bat to open all of them at once.

It would also be nice if it could do this with the bats being hidden.
Title: Re: .bat that opens all .bat files in the subfolders of its folder
Post by: ghostdog74 on August 25, 2007, 08:40:16 PM
what have you got so far...
Title: Re: .bat that opens all .bat files in the subfolders of its folder
Post by: Sir.Laggalot on August 25, 2007, 08:42:02 PM
I dont have any thing so far, i have been working on the hider, (the program it is opening)

The program is such.. (a neater version then before)

@ ECHO OFF
title Image Concealer
:: A Sir.Laggalot Creation

IF EXIST *.jpg. GOTO HIDE
 IF EXIST *.gif. GOTO HIDE
  IF EXIST *.png. GOTO HIDE
   IF EXIST *.mp3. GOTO FIX
    IF EXIST *.mp4. GOTO FIX
     IF EXIST *.avi. GOTO FIX
      ECHO.
      ECHO ERROR-
      ECHO There are no .jpg, .gif, .png, .mp3, .mp4, or .avi files to effect.
      ECHO.
      ECHO.
       PAUSE
        GOTO END
:HIDE
 REN *.jpg *.mp3
  ATTRIB "./*.mp3" +h
   REN *.gif *.mp4
    ATTRIB "./*.mp4" +h
     REN *.png *.avi
      ATTRIB "./*.avi" +h
       GOTO END
:FIX
ATTRIB "./*.mp3" -h
 REN *.mp3 *.jpg
  ATTRIB "./*.mp4" -h
   REN *.mp4 *.gif
    ATTRIB "./*.avi" -h
     REN *.avi *.png
      GOTO END
:END
Title: Re: .bat that opens all .bat files in the subfolders of its folder
Post by: Carbon Dudeoxide on August 26, 2007, 05:39:18 AM
And you want to....open all those files at once?

Quote
I want a master bat to open all of them at once.
Title: Re: .bat that opens all .bat files in the subfolders of its folder
Post by: Sir.Laggalot on August 26, 2007, 01:58:36 PM
I got a rough way to do it now but i want a bat file which will find all bat files of a certain name or not in the subfolders of a folder and execute them.
Title: Re: .bat that opens all .bat files in the subfolders of its folder
Post by: ray.tomar on August 28, 2007, 03:49:51 PM
Hi, I hope this will help you out.

You can use the ATTRIB command to protect as well as hide all the files inside any directory.

you can use this command to hide.

ATTRIB +s +r +h *.*

In order to run each .bat file you can use CALL batchfilename.bat command in master batch file to run individual batch files.

In fact you can also use START batchfilename.bat command to start a new window for running batch files.