Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#148631 - 14/03/2003 13:31 date compare
Phoenix42
veteran

Registered: 21/03/2002
Posts: 1424
Loc: MA but Irish born
Have spent the morning on and off trying to find a solution to this, but no go.

What I'm trying to do:
I want to creat a bootable CD that re-images a computer using ghost. This I have and it all works great.
But I now need to add a restriction, I need this CD only to be good until a certain date, after which it just does nothing.

Plan of attack:
Compare todays date with the best before date, but how todo this in a DOS enviroment?

Help!

Top
#148632 - 14/03/2003 14:06 Re: date compare [Re: Phoenix42]
Redrum
old hand

Registered: 17/01/2003
Posts: 998
I used this code years ago as part of a bat file that puts the date in the name of a file.

Maybe you can use some of it. I really can't recall the details, its been years.


for /F "tokens=1-4 delims=/ " %%i in ('date /t') do (
set DayOfWeek=%%i
set Month=%%j
set Day=%%k
set Year=%%l
set Date=%%i %%j/%%k/%%l
)

ECHO Date is %Date%
ECHO Day of Week is "%DayOfWeek%", Month is "%Month%"
ECHO Day is "%Day%", Year is "%Year%"

Top
#148633 - 14/03/2003 14:55 Re: date compare [Re: Phoenix42]
djc
enthusiast

Registered: 08/08/2000
Posts: 351
Loc: chicago
how do you plan on keeping someone from spoofing the BIOS date?

--dan.

Top
#148634 - 14/03/2003 19:33 Re: date compare [Re: djc]
Phoenix42
veteran

Registered: 21/03/2002
Posts: 1424
Loc: MA but Irish born
Fair question, the systems these will be used on already have the BIOS locked, but you are correct they would be able to by pass it if the could change the date.
Another way they could by pass would be to run ghost manually, but I have a possible solution for that as well.

But as I frequently find out there is always a better id10t out there!

Top
#148635 - 16/03/2003 10:28 Re: date compare [Re: Phoenix42]
Phoenix42
veteran

Registered: 21/03/2002
Posts: 1424
Loc: MA but Irish born
Found something that will do it for me

So the only "code" I need to add to the batch file is
SET EOL=03-17-2003

fdate /FTcomp /Atoday /B%EOL% >nul
if errorlevel 101 if not errorlevel 103 echo Useable
if errorlevel 103 if not errorlevel 104 echo Out of date


Fdate is capable of alot more then that though.

Top