---
title: Windows Dynamic System Environment Variables
description: For the longest time I have used 4NT as a replacement for the Windows CMD.exe shell. It provides an environment variable, _CWD, that provides the current working directory. I never knew that Windows also provides the same thing, in the form of the CD environment variable. This led me to look for other system-wide default dynamic variables that Windows provides.
---

[Fresh Thoughts Blog](https://blog.thoughtlabs.com/blog)

# [Windows Dynamic System Environment Variables](https://blog.thoughtlabs.com/blog/windows-dynamic-system-environment-variables)

 Written by [Cappy Popp](https://blog.thoughtlabs.com/blog/author/cappy-popp) | Dec 5, 2007

For the longest time I have used [4NT](http://jpsoft.com/) as a replacement for the Windows CMD.exe shell. It provides an environment variable, \_CWD, that provides the current working directory. I never knew that Windows also provides the same thing, in the form of the CD environment variable. This led me to look for other system-wide default dynamic variables that Windows provides.

I've found these:

| Variable | Sample Typical Value |
| --- | --- |
| **%CD%** | The current directory. |
| **%DATE%** | *Current date in the format set by the **Date** command* |
| **%TIME%** | *Current time in the format set by the **Time** command* |
| **%ERRORLEVEL%** | A number defining exit status of a previous command or called executable. |
| **%RANDOM%** | A random number between 0 and 32767. |

[View full post](https://blog.thoughtlabs.com/blog/windows-dynamic-system-environment-variables)

```json
{
  "@context" : "http://schema.org",
  "@type" : "BlogPosting",
  "author" : {
    "@type" : "Person",
    "name" : "Cappy Popp"
  },
  "dateModified" : "2024-03-20T18:52:48.352Z",
  "datePublished" : "2007-12-05T05:00:00Z",
  "headline" : "Windows Dynamic System Environment Variables",
  "image" : {
    "@type" : "ImageObject",
    "height" : 694,
    "url" : "https://44656869.fs1.hubspotusercontent-na1.net/hubfs/44656869/Imported_Blog_Media/cmd.jpg",
    "width" : 1356
  },
  "mainEntityOfPage" : "https://blog.thoughtlabs.com/blog/windows-dynamic-system-environment-variables",
  "publisher" : {
    "@type" : "Organization",
    "logo" : {
      "@type" : "ImageObject",
      "height" : 60,
      "url" : "/hs/hsstatic/content_shared_assets/static-1.4092/img/default-amp-logo.png",
      "width" : 60
    },
    "name" : "Fresh Thoughts Blog"
  }
}
```