> On Jan 30, 2024, at 8:01 AM, Jürgen Wondzinski via Freedos-user 
> <[email protected]> wrote:
> 
> Hi Jerome,
>  
> Perfect! Thanks for the pointer to that VSTR utility!
>  
> wOOdy

Your welcome

:-)

>  
> Von: Jerome Shidel via Freedos-user <[email protected] 
> <mailto:[email protected]>> 
> Gesendet: Dienstag, 30. Januar 2024 13:38
> An: FreeDOS Users <[email protected] 
> <mailto:[email protected]>>
> Cc: [email protected] <mailto:[email protected]>
> Betreff: Re: [Freedos-user] Date check
>  
> Hi,
> Sure. 
>  
> You can have date output the current date and save it in an environment 
> variable. 
> The test the return string against the known BAD value.
>  
> Something like…
>  
> set /e TODAY=date /d
> if “%TODAY%” == “Current date is TUE 01-30-2024” goto BadDate
> goto GoodDate
> :BadDate
> date
> time
> :GoodDate
> set TODAY=
>  
>  
> Or, if you want to get a little more fancy…
>  
> date /d | vstr /b /f “ “ 5- | set /p TODAY=
> if “%TODAY%” == “01-30-2024” goto BadDate
> (see above)
>  
> Or, even just check the year…
>  
> date /d | vstr /b /f - 3 | set /p YEAR=
> if “%YEAR%” == “2024” goto BadDate
> (see above)
>  
> Or, even better…
>  
> date /d | vstr /b /f - 3 | set /p YEAR=
> if NOT “%YEAR%” == “1980” goto GoodDate
> date
> time
> :GoodDate
> set YEAR=
>  
> _______________________________________________
> Freedos-user mailing list
> [email protected] <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/freedos-user 
> <https://lists.sourceforge.net/lists/listinfo/freedos-user>
_______________________________________________
Freedos-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to