Batch run all files of one filetype.

Discussion in 'Windows - Software discussion' started by YoMaMMa18, May 16, 2009.

  1. YoMaMMa18

    YoMaMMa18 Member

    Joined:
    May 10, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    11
    I have a batch file that is creating files using redirect output:
    ex.
    ECHO shutdown -a > shutdownabort.bat
    however i need tons of then, and all seperatly named, so i have
    ECHO shutdown -a > shutdownabort%RANDOM%.bat
    is there a way to run all files in the current directory with a certain extension?
    ex. running all .bat or .vbs files in a folder with a command.
     
  2. YoMaMMa18

    YoMaMMa18 Member

    Joined:
    May 10, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    11
    Problem Solved:
    FOR %%a (*.bat) DO start %%a
    Will start all bat files in current directory.
    Unless i wrote the code wrong. Did it was from memory.
     

Share This Page