Command Prompt for Windows

XSET Example

Consider the following batch file :-

@ECHO off
IF ("%update%"=="") {
	ECHO No last access.
} ELSE {
	DATE2SER %date_today%
	SET today=%date2ser%
	DATE2SER %update%
	LET days=%today%-%date2ser%
	ECHO Last access on %update%, %days% days ago.
GETKEY Update last access (Y/N) ?
UPPER %getkey%
IF ("%upper%"=="Y") XSET update=%date_today%

The above batch file demonstrates the use of command XSET and uses a persistent environment variable to determine the last date an access occurred. An access can refer to anything, for example, dialing into a BBS etc.