Why can't I access a variable named __CD__ on Windows 7?

前端 未结 5 2177
渐次进展
渐次进展 2020-12-01 14:47

Note - this question is based on behavior observed on Windows 7. I believe the behavior applies to all other versions from Vista onward. Based on MC ND\'s answer, and Fo

5条回答
  •  隐瞒了意图╮
    2020-12-01 15:08

    According to this command line reference there are read-only environment variables, where __CD__ is included.

    From that page:

    Undocumented Dynamic variables (read only)

    %__CD__% The current directory, terminated with a trailing backslash.

    %=C:% The current directory of the C: drive.

    %=D:% The current directory of the D: drive if drive D: has been accessed in the current CMD session.

    %=ExitCode% The hex value of the last return code set by EXIT /B

    %=ExitCodeAscii% The ASCII value of the last return code set by EXIT /B if greater than 32.

提交回复
热议问题