Skip navigation

JSI Tip 3239. Windows 2000 has some hidden environment variables?

When Command Extension are enabled, which is the default, Windows 2000 defines several environment variables that are hidden, they do not display when you type SET.

These variables are computed dynamically, each time you use them.

NOTE: If a user defines a variable by one of these names, it overrides the default definition.

The dynamic variables are:


 D e s c r i p t i o n 

 Expands to the current directory. If your current folder is %USERPROFILE%\My Documents,
@echo %CD% might display C:\Documents and Settings\Jerry\My Documents.


 Expands to the same output as typing DATE. 


 Expands to the same output as typing TIME. 


 Generates a random integer in the range of 0 - 32767. 


 Expands to the current ERRORLEVEL. 


 Expands to the current Command Processor Extensions version number. 


 Expands to the original command line that invoked the Command Processor. 

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.