Advertisement

07.19.2008 at 09:57AM PDT, ID: 23579210
[x]
Attachment Details

windows batch program to process each file in directory & delete it after processing

Asked by ptoomen in MS DOS, Microsoft Windows Operating Systems

This is my requirement
1. Schedule a batch program to keep looking in a certian dirctory for files starting with a particular pattern. Files are FTPed from some other system to this directory.
2. Process files satisfying the above selection criteria.
3. For each file do the following:
3.a  Make sure files that have completed file tranfer are picked up
3.b  Perform a batch command on this file that does some processing
3.c  Once the batch command mentioned above has finishes execution, delete the file

The below command does part of my requirements
FOR /F "tokens=*" %%G IN ('dir/b ^"d:\testdir\pattern_*^"') DO d:\soft\load\LOAD d:\testdir\%%G

I think things missed out are
1. ensure I pick only files that have finished file transfer
2. delete files after processing

Please advise.Start Free Trial
[+][-]07.19.2008 at 10:10AM PDT, ID: 22043079

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MS DOS, Microsoft Windows Operating Systems
Sign Up Now!
Solution Provided By: knightEknight
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.20.2008 at 03:51PM PDT, ID: 22047293

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.21.2008 at 04:03PM PDT, ID: 22055204

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_Related_20080208