Input Data from a text file into a batch file variable.
Posted on 2005-04-04
I have a small problem, I have a batch file that I wrote (see code below) that I need to input data from a text file into a variable within the batch file. The data the the text file will contain is simply today's date in the following format (Mon 04/03/2005) which will be read into the batch file and be used the following day. In short what I'm trying to accomplish is a date misus one calculation without writing some big log script to do the calculations. I wrote a VB app that does exactly what I need it to do, but the securtiy nazi's around here told me that I can't use exe's or VB scripts on the servers...
rem setting the current date
Rem TempDate <-- This is the variable that I want to get from another file.
rem creating file name using current date and
rem copying to another location using the same name.
rem change copy command to reflect desired locations.
copy c:\temp\ex%yy%%mm%%dd%.log c:\temp2\ex%yy%%mm%%dd%.log