For...next...step loops in DOS
Results 1 to 3 of 3

Thread: For...next...step loops in DOS

  1. #1
    Join Date
    Oct 1999
    Location
    Wichita, Kansas, USA
    Posts
    1

    For...next...step loops in DOS

    I am running win98 and have large amounts of files that I am changing from .htm to .asp. I wrote a batch file to go into each directory and rename *.htm *.asp.

    Then problem is that I have to have a command specific to each dir...ie.

    cd 010
    rename *.htm *.asp
    cd ../
    cd 020
    rename *.htm *.asp
    cd ../

    and this repeats for the number of directories in the directory structure.

    It would be easier if I could do a for next loop like the following

    for i=10; i++; step 10
    cd 0i
    rename *.htm *.asp
    next


    But I cannot find any documentation that says if DOS batch files support for next loops, or if they do. what the syntax is to accomplish this.

    Any help would be greatly appreciated

    James

  2. #2
    Join Date
    Oct 1999
    Posts
    12
    No, no for next loops in batch files...

  3. #3
    Join Date
    Jul 1999
    Location
    Jenkinsville, SC, USA
    Posts
    232
    You may want to consider a program called AutoIt, which you can get at http://www.hidden.demon.co.uk/AutoIt/index.html ; this is a freeware program that allows you to do what you want and much more.

    Hope this helps!

    ------------------
    -= Victor =-
    Victor Gascon
    Senior Field Engineer
    INACOM Corp.
    -= Victor =-
    Victor Gascon
    Senior Field Engineer
    INACOM Corp.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •