Discussion Locked

Task Scheduling with variables

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I have scheduled the task of export of oracle database on NT 4.0 server. My problem is that everytime the task executed, the export file is over written by it. I want to use a variable in it so daily I can get a new file as well as the old file is available. I have tried with %DATE% but it hasn't worked.

1 reply

by tbragsda

Are you running a batch file to do this. If so, you could put this in it at the end, or if not in a new batch, and schedule it later.

@ECHO OFF
::
:: Batch to rename some file to current date.
::
VER | date > Temp.BAT
ECHO SET Date=%%4>Current.BAT
ECHO SET Date=%%5>The.BAT
CALL Temp.BAT
Del TEMP.BAT > nul
Del CURRENT.BAT > nul
Del The.bat > nul

xcopy %Date% /i

You can get much more elaborate. Some errorchecking etc, but this is the basic idea.

This discussion is closed to new replies.