add %time% and %cd% internal value. Example echo %cd% or echo %time%.
Modified: trunk/reactos/subsys/system/cmd/cmd.c
_____
Modified: trunk/reactos/subsys/system/cmd/cmd.c
--- trunk/reactos/subsys/system/cmd/cmd.c 2005-07-07 11:44:15 UTC
(rev 16482)
+++ trunk/reactos/subsys/system/cmd/cmd.c 2005-07-07 13:43:03 UTC
(rev 16483)
@@ -993,8 +993,22 @@
evar = malloc ( size * sizeof(TCHAR));
if (evar==NULL)
return 1;
-
- if (_tcsicmp(ip,_T("errorlevel")) ==0)
+
+ if (_tcsicmp(ip,_T("cd")) ==0)
+ {
+ TCHAR szPath[MAX_PATH];
+ GetCurrentDirectory (MAX_PATH, szPath);
+ cp = _stpcpy (cp, szPath);
+ }
+
+ else if (_tcsicmp(ip,_T("time")) ==0)
+ {
+ TCHAR szTime[40];
+ GetTimeFormat(LOCALE_USER_DEFAULT, 0, NULL, NULL,
szTime, sizeof(szTime));
+ cp = _stpcpy (cp, szTime);
+ }
+
+ else if (_tcsicmp(ip,_T("errorlevel")) ==0)
{
memset(evar,0,512 * sizeof(TCHAR));
_itot(nErrorLevel,evar,10);
Show replies by date