Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello,
I'm looking for some help with creating a script (of any flavor) that will accomplish the following:
I have a vendor supplied executable that processes text files based on the name of the text file. The text filename is an argument that can be given to the executable. When this is run, it creates a log file and reject file. This is great if I have one text file that needs to be processed now and then, but I will have several of these txt files generated every hour. I need the ability to envoke the executable to process new txt files that will have a time stamp (making them unique), and save the log\reject for each txt file processed.
I can't tell the executable to simply process *.txt...it does not like that.
Any and all help would be greatly appreciated!!

cranky_pants,
I personally would use VBScript on a Windows platform. Without writing the entire script, here are the steps I'd take:
1) Create a .vbs file using notepad
2) Use the FileSystemObject to open a folder, and "look" for files within that folder
3) When file(s) are found, process them with the executable by calling a Shell.Run on the executable.
4) Once this .vbs is written, schedule it with Windows Scheduler (scheduled tasks).Hope this helps,
Curtis
Curtis Hughes
StreamLogic Inc.
http://www.streamlogicinc.com

If it's simply a matter of getting the exe to act on each txt file:
::== mp.bat
@echo off
setLocal EnableDelayedExpansionfor /f "tokens=* delims=" %%A in ('dir /b *.txt') do (
myprog %%A
)
=====================================
If at first you don't succeed, you're about average.M2

If you need to track which have been done and not do any one twice, try this:
::== m3.bat
@echo off >> done.log
setLocal EnableDelayedExpansionfor /f "tokens=* delims=" %%A in ('dir /b *.txt') do (
find "%%A" < done.log > nul
if errorlevel 1 call :sub1 %%A
)
goto :eof:sub1
echo %* >> done.log
echo prog %*
goto :eof
=====================================
If at first you don't succeed, you're about average.M2

![]() |
![]() |
![]() |

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