Avatar of ptoomen
ptoomen

asked on 

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

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.
Microsoft DOSWindows OS

Avatar of undefined
Last Comment
AmazingTech
ASKER CERTIFIED SOLUTION
Avatar of knightEknight
knightEknight
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ptoomen
ptoomen

ASKER

Thanks Kinght! I will test tomorrow & let you know.
SOLUTION
Avatar of AmazingTech
AmazingTech

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Windows OS
Windows OS

This topic area includes legacy versions of Windows prior to Windows 2000: Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions including Windows Mobile.

129K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo