• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

help!

SaigonK

Diamond Member
So i need to run a util, copy the output to a text file in DOS, but then i need to run it again at set intervals.

The issue is I dont want to append or overwrite the files, so is there a way to append the date and time to each file as it is written?
 
Sure, accept the system date to a variable, then rename your file to the new name+datevar. I do it all the time.
 
I think writing a C program or hell even a basic program (if you're on a really old computer) would work better. Otherwise, if I remember correctly something like

program.exe > output.txt

would put the output of the program into the text file. I don't know how you would implement a batch file to operate on certain time intervals, as I don't think they're that advanced but hey, I could be wrong.
 
Originally posted by: effowe
I think writing a C program or hell even a basic program (if you're on a really old computer) would work better. Otherwise, if I remember correctly something like

program.exe > output.txt

would put the output of the program into the text file. I don't know how you would implement a batch file to operate on certain time intervals, as I don't think they're that advanced but hey, I could be wrong.


You could use AT or Task scheduler, or even make it loop itself every so many minutes and then put it in a service.
 
The easiest way to make it run according to a time schedule is to use scheduled tasks.
Do you need a batch for that? Run schtasks /? from a command prompt for more info.

REM ==============================================

REM First capture the date ant time to variables

for /f "tokens=1 delims=!" %%a in ('date /t') do set CaptureDate=%%a
REM Remove the /'s from the date
SET CaptureDate=%CaptureDate:/=%
for /f "tokens=1 delims=!" %%a in ('time /t') do set CaptureTime=%%a


REM THEN run your progam and output it to a file using the captured variables

C:\temp\program.exe >> Porgram%CaptureDate%_%CaptureTime%.log

EXIT
 
Back
Top