Computing.Net > Forums > Windows XP > Looping through the files in directory

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Looping through the files in directory

Reply to Message Icon

Name: epipko
Date: September 8, 2009 at 09:45:37 Pacific
OS: Windows 2003
CPU/Ram: 4/8G
Product: Unitech Pt630d mobile computer, batch, 1d lr ccd, dos, 2.5mb ram, 27-key, 900mah 3.7v li-ion, p/s, rs-232
Subcategory: General
Tags: batch, loop
Comment:

Hi all,
I am running Windows 2003.
I am new to batch files, but need to do the following with your help:
I have a directory with 2 -3 files (potentially). I need to write .bat file that will take the first file (ba_20090908.txt) and
1. copy it to another dir
2. rename it
3. run a procedure against it
4. remove it from original dir

Then do the same with the next file in the directory, then next ... till they all processed.

Thanks,
Eugene



Sponsored Link
Ads by Google

Response Number 1
Name: Ed in Texas.
Date: September 9, 2009 at 03:58:13 Pacific
Reply:

epipko, I'd first establish a variable 'x' and name it my active filename, then do whatever was required to 'x' and when done, clear 'x' and carry on to the next file and do it again, etc. You could use an 'if/then/else' to tell the process when to stop.
HTH.
Ed in Texas.


0
Reply to Message Icon

Related Posts

See More


Lost Pasword connection speed



Post Locked

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


Go to Windows XP Forum Home


Sponsored links

Ads by Google


Results for: Looping through the files in directory

the file or directory is corrupted www.computing.net/answers/windows-xp/the-file-or-directory-is-corrupted-/140927.html

Delete lines form file using batch www.computing.net/answers/windows-xp/delete-lines-form-file-using-batch/177936.html

Suspecious file in startup www.computing.net/answers/windows-xp/suspecious-file-in-startup/88698.html