Reputation: 3735
On Windows 7, I created a system environment variable. Surprised to find that I cannot access its value.
JETTY_HOME=D:\workspace\jetty-distribution-9.4.8.v20171121
C:\Users\me>cd %JETTY_HOME%
C:\Users\me>set
....
JETTY_HOME=D:\workspace\jetty-distribution-9.4.8.v20171121
....
C:\Users\me>cd JETTY_HOME
The system cannot find the path specified.
Upvotes: 1
Views: 269
Reputation: 3494
The plain cd command does not change the current drive from c: to d:. The /d switch tells the command to also change the drive. So:
CD /D %JETTY_HOME%
Works from any drive.
Upvotes: 3