People,
Basically firstly want to say cheers to Leonardo (aka Secret_doom) for helping me out with this one. So much help and solved a big headache for me! I owe him a beer!
I used one of his batch scripts to pass the current date into a variable, but I required a 2 digit year (as the files I was trying to get had a 2 digit year (ie 02).
Below is the script and the fix, so that anyone else who needs to sort this one out can do so too.
Again thanks go to Leonardo...Everyone else, go to www.batch.hpg.com.br for some top batch file stuff !!
Hello, Andrew.
Saw the site BTW...very good. Like it alot,
and helped me out a few times.
It's good to hear that.
About the batch file, modify this line:
for %%? in (e10D''3B e110''3B w q) do echo %%?>> %TEMP%.\T2.DAT
By this:
for %%? in (e10D''3B f110L3''3B w q) do echo %%?>> %TEMP%.\T2.DAT
And it's done! Here's the modifyed batch file (maybe a little bit different from the one you've got, I've updated that FAQ yesterday):
:: Get current date into variable without separators
@echo off
echo.EXIT|%COMSPEC%/K PROMPT SET %%1=$D$_|FIND " "> %TEMP%.\T1.BAT
type nul> %TEMP%.\T2.DAT
for %%? in (e10D''3B f110L3''3B w q) do echo %%?>> %TEMP%.\T2.DAT
DEBUG %TEMP%.\T1.BAT nul
call %TEMP%.\T1.BAT CDATE
:: Next line defines date format. The values generally are:
:: %%1=Week day %%2=Month %%3=Date %%4=Year (4 digits)
:: Those could change, depending mainly on the COUNTRY
:: command (from config.sys).
echo SET CDATE=%%4%%2%%3> %TEMP%.\T1.BAT
call %TEMP%.\T1.BAT %CDATE%
for %%? in (T1.BAT T2.DAT) do del %TEMP%.\%%?
echo CDATE=%CDATE%
Im using MS DOS 6.22 if thats any help.
Yes, that's of much help =D
-- Leonardo Pignataro - Secret_Doom --