释义 |
System environment
英语百科
Environment variable
%CD% - This pseudo-variable expands to the current directory equivalent to the output of the command
CD when called without arguments. While a long filename can be returned under CMD.EXE depending on the current directory, the fact that the current directory will always be in 8.3 format under COMMAND.COM will cause it to return a short filename under COMMAND.COM , even when COMMAND internally calls CMD .
%CMDCMDLINE% - This pseudo-variable expands to the original startup parameters of
CMD.EXE , f.e. "C:\Windows\system32\cmd.exe ". Under Windows' COMMAND.COM , this may return something like "C:\Windows\system32\cmd.exe /c ... " due to the fact that COMMAND.COM calls CMD.EXE internally.
%CMDEXTVERSION% - This pseudo-variable expands to the version of the command-line extensions of
CMD.EXE , if enabled (e.g. "1 " under Windows NT, "2 " under Windows 2000 and Windows XP).
%DATE% - This pseudo-variable expands to the current date. The date is displayed according to the current user's date format preferences.
%ERRORLEVEL% - This pseudo-variable expands to the last set error level, a value between "
0 " and "255 " (without leading zeros). External commands and some internal commands set error levels upon execution. See also the identically named pseudo-variable %ERRORLEVEL% under DR-DOS and the IF ERRORLEVEL command.
%RANDOM% - This pseudo-variable returns a random number between "
0 " and "32767 ".
%TIME% - This pseudo-variable returns the current time. The time is displayed according to the current user's time format preferences. If the
%TIME% and %DATE% variables are both used, it is important to read them both in this particular order in rapid succession in order to avoid midnight-rollover problems.
|