039 Windows 各路徑指令

Post date: 2015/6/4 上午 01:17:49

Windows[edit]

System path variables[citation needed] refer to locations of critical operating system resources, and as such generally are not user-dependent.

系統路徑變量[ 來源請求 ] 參見關鍵操作系統資源的位置,因此一般不取決於用戶。

%APPDATA%

Contains the full path to the Application Data directory of the logged-in user. Does not work on Windows NT 4.0 SP6 UK.

包含完整路徑 應用數據 登錄的用戶的目錄。不能在Windows NT 4.0 SP6英國工作。

%LOCALAPPDATA%

This variable is the temporary files of Applications. Its uses include storing of desktop themes, Windows error reporting, caching and profiles of web browsers.

這個變量是臨時文件 的應用程序。其用途包括存儲的 桌面主題Windows錯誤報告,緩存和Web瀏覽器的配置文件。

%ComSpec%/%COMSPEC%

The %ComSpec% variable contains the full path to the command processor; on Windows NT-based operating systems, this is CMD.EXE, while on Windows 9x and ME, %COMSPEC% is the DOS command processor, COMMAND.COM.

COMSPEC%% 變量包含了完整路徑命令處理器; 在基於Windows NT的操作系統,這是 CMD.EXE,而在Windows 9x和ME, COMSPEC%% 是DOS命令處理器, COMMAND.COM

%OS%

The %OS% variable contains a symbolic name of the operating system family to distinguish between differing feature sets in batchjobs. Under Windows NT, Windows 2000, Windows XP and Windows 7, it always holds the string "Windows_NT". It resembles an identically named environment variable %OS% found in all DOS-related operating systems of Digital Research-origin like Concurrent DOS, Multiuser DOS, REAL/32, DOS Plus, DR DOS, Novell DOS and OpenDOS.

OS%% 變量包含了操作系統系列不同功能集於batchjobs區分的符號名。在 Windows NT的Windows 2000中Windows XP中Windows 7中,它總是持有字符串“ Windows_NT “。它類似於一個同名的環境變量 %OS%, 在所有的DOS相關的操作系統上可以找到 數字研究 -origin像並發DOS,多用戶DOS,REAL / 32,DOS此外,DR DOS,Novell的DOS和OpenDOS。

%PATH%

This variable contains a semicolon-delimited (do not put spaces in between) list of directories in which the command interpreter will search for an executable file that matches the given command. Environment variables that represent paths may be nested within the%PATH% variable, but only at one level of indirection. If this sub-path environment variable itself contains an environment variable representing a path, %PATH% will not expand properly in the variable substitution. Equivalent to the Unix $PATH variable.

這個變量包含一個分號分隔(不要加空格之間),其中的命令解釋器將搜索匹配給定 ​​命令的可執行文件的目錄列表。可嵌套的內表示路徑環境變量%PATH% 變量,但只能在一個間接層。如果該子PATH環境變量本身含有較路徑的環境變量, %PATH% 將不能正常的變量替換展開。相當於 Unix的 $ PATH 變量。

%ProgramFiles%, %ProgramFiles(x86)%, %ProgramW6432%

The %ProgramFiles% variable points to the Program Files directory, which stores all the installed programs of Windows and others. The default on English-language systems is "C:\Program Files". In 64-bit editions of Windows (XP, 2003, Vista), there are also %ProgramFiles(x86)%, which defaults to "C:\Program Files (x86)", and %ProgramW6432%, which defaults to "C:\Program Files". The %ProgramFiles% itself depends on whether the process requesting the environment variable is itself 32-bit or 64-bit (this is caused by Windows-on-Windows 64-bit redirection).

的%ProgramFiles% 變量指向 程序文件 的目錄,它存儲的Windows和其他所有已安裝的程序。在英文系統默認為“ C:\ Program Files文件 “。在Windows(XP,2003,Vista)的64位版本,還有 的%ProgramFiles(x86)的%,默認為“ C:\ Program Files文件(x86)的 “,並 %ProgramW6432% ,默認為“ C: \ Program Files文件 “。該 的%ProgramFiles% 本身取決於請求環境變量的過程本身是否是32位或64位(這是由於 Windows的在Windows的64位 重定向)。

%CommonProgramFiles%

This variable points to the Common Files directory. The default is "C:\Program Files\Common Files" in the English version of Windows.

此變量指向的 公用文件 目錄。默認為“ C:\ Program Files文件\ Common Files文件 “在Windows的英文版本。

%SystemDrive%

The %SystemDrive% variable is a special system-wide environment variable found on Windows NT and its derivatives. Its value is the drive upon which the system directory was placed. The value of %SystemDrive% is in most cases "C:".

的%SystemDrive% 變量是Windows NT和它的衍生物發現了一個特殊的系統範圍的環境變量。它的價值是在其系統目錄中放置的驅動器。值 的%SystemDrive%, 在大多數情況下,“ C: “。

%SystemRoot%

The %SystemRoot% variable is a special system-wide environment variable found on Windows NT and its derivatives. Its value is the location of the system directory, including the drive and path. The drive is the same as %SystemDrive% and the default path on a clean installation depends upon the version of the operating system. By default, Windows NT 5.1 (Windows XP) and newer versions use "\WINDOWS", Windows NT 5.0 (Windows 2000), Windows NT 4.0 and Windows NT 3.1 use "\WINNT", Windows NT 3.5x uses "\WINNT35", and Windows NT 4.0 Terminal Server uses "\WTSRV".

%SYSTEMROOT% 變量是Windows NT和它的衍生物發現了一個特殊的系統範圍的環境變量。它的值是系統目錄的位置,包括驅動器和路徑。該驅動器是一樣 的%SystemDrive% 和默認路徑在一個乾淨的安裝取決於操作系統的版本。默認情況下,Windows NT的5.1(Windows XP中)和新版本使用“ \ WINDOWS “時,Windows NT 5.0(Windows 2000中)時,Windows NT 4.0和Windows NT 3.1使用“ \ WINNT “時,Windows NT 3.5x中使用” \ WINNT35 “和Windows NT 4.0終端服務器使用“ \ WTSRV “。

%windir%

This variable points to the Windows directory (on Windows NT-based operating systems it is identical to the %SystemRoot% variable, above). If the system is on drive C:, then the default values are "C:\WINDOWS" on Windows 95, Windows 98, Windows Me,Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008 and Windows 7 and "C:\WINNT" for Windows NT 4, and Windows 2000. Windows NT 4 Terminal Server Edition by default installs to "C:\WTSRV".

User management variables[citation needed] store information related to resources and settings owned by various user profiles within the system. As a general rule, these variables do not refer to critical system resources or locations that are necessary for the OS to run.

這個變量指向 的Windows 目錄(在基於Windows NT的操作系統,它等同於 %SYSTEMROOT% 變量,以上)。如果系統在驅動器C :,則默認值是“ C:\ WINDOWS “在 Windows 95中視窗98Windows Me中Windows XP中在Windows Server 2003Windows Vista中Windows Server 2008的Windows 7中 的“ C: \ WINNT “為 的Windows NT 4和Windows 2000的Windows NT 4終端服務器版默認安裝到“ C:\ WTSRV “。

用戶管理變量[ 來源請求 ] 涉及到的各種擁有的資源和設置信息存儲 用戶配置文件 的系統之內。作為一般規則,這些變量不指關鍵系統資源或所必需的操作系統來運行的位置。

%ALLUSERSPROFILE% (%PROGRAMDATA% for Windows Vista, Windows 7)

This variable expands to the full path to the All Users profile directory. This profile contains resources and settings that are used by all system accounts. Shortcut links copied to the All Users\' Start menu or Desktop directories will appear in every user's Start menuor Desktop, respectively.

這個變量擴展到完整路徑 的所有用戶 配置文件目錄。此配置文件包含所使用的所有系統帳戶資源和設置。 快捷方式 複製到鏈接的 所有用戶 \“ 開始菜單桌面 目錄將出現在每個用戶的 開始菜單桌面,分別。

%USERDOMAIN%

The name of the Workgroup or Windows Domain to which the current user belongs. The related variable, %LOGONSERVER%, holds the hostname of the server that authenticated the current user's logon credentials (name and password). For home PCs and PCs in a workgroup, the authenticating server is usually the PC itself. For PCs in a Windows domain, the authenticating server is a domain controller (a primary domain controller, or PDC, in Windows NT 4-based domains).

該名 工作組Windows域 ,以當前用戶所屬。相關的變量, LOGONSERVER%% ,持有 主機 的驗證當前用戶的登錄憑據(名稱和密碼)的服務器。對於家用電腦和個人電腦在工作組中,認證服務器通常是PC本身。對於Windows域中的計算機,身份驗證服務器是 域控制器 (主域控制器,或PDC,在Windows NT 4,基於域)。

%USERPROFILE%

A special system-wide environment variable found on Windows NT and its derivatives. Its value is the location of the current user's profile directory, in which is found that user's HKCU registry hive (NTUSER). Users can also use the %USERNAME% variable to determine the active users login identification.

Optional System variables[citation needed] are not explicitly specified by default but can be used to modify the default behaviour of certain built-in console commands. These variables also do not need to be explicitly specified as command line arguments.

在Windows NT和它的衍生物發現一個特殊的系統範圍內的環境變量。它的值是當前用戶的配置文件目錄的位置,在其中發現該用戶的HKCU註冊表配置單元(NTUSER)。用戶還可以使用 %USERNAME% 變量,以確定活動用戶登錄標識。

可選的系統變量[ 需要的引證 ] 沒有明確缺省情況下,但可以用來修改某些內置控制台命令的默認行為。這些變量也無需顯式地指定作為命令行參數。

Default values[edit]

The following tables shows typical default values of certain environment variables under English versions of Windows as they can be retrieved under CMD.

(Some of these variables are also defined when running COMMAND.COM under Windows, but differ in certain important details: Under COMMAND.COM, the names of environment variable are always uppercased. Some, but not all variables contain short 8.3 rather thanlong file names. While some variables present in the CMD environment are missing, there are also some variables specific to the COMMAND environment.)

下表顯示了在英語版本的Windows的某些環境變量的典型默認值,因為他們可以在檢索 CMD

(其中的一些變量也被定義運行時, COMMAND.COM 在Windows下,但不同的某些重要的細節:在 COMMAND.COM,環境變量的名稱總是大寫一些,但不是所有的變量包含短 8.3 ,而不是長文件名。儘管目前在一些變量 CMD 環境缺失,也有特定的一些變量 COMMAND 環境)。

In this list, there is no environment variable that refers to the location of the user's My Documents directory, so there is no standard method for setting a program's home directory to be the My Documents directory.

Pseudo-environment variables[edit]

DOS[edit]

Besides true environment variables, which are statically stored in the environment until changed or deleted, a number of pseudo-environment variables exist for batch processing.

The so-called replacement parameters or replaceable parameters (Microsoft / IBM terminology) aka replacement variables (Digital Research / Novell / Caldera terminology)[5] or batch file parameters (JP Software terminology)[1] %1..%9 and %0 can be used to retrieve the calling parameters of a batchjob, see SHIFT. In batchjobs, they can be retrieved just like environment variables, but are not actually stored in the environment.

Some command-line processors (like DR-DOS COMMAND.COM,[5] Multiuser DOS MDOS.COM/TMP.EXE, JP Software 4DOS, 4OS2, 4NT, Take Command and Windows CMD.EXE) support a type of pseudo-environment variables named system information variables(Novell / Caldera terminology)[5] or internal variables (JP Software terminology),[1] which can be used to retrieve various possibly dynamic, but read-only information about the running system in batch jobs. The returned values represent the status of the system in the moment these variables are queried; that is, reading them multiple times in a row may return different values even within the same command; querying them has no direct effect on the system. Since they are not stored in the environment, they are not listed by SETand do not exist for external programs to retrieve. If a true environment variable of the same name is defined, it takes precedence over the corresponding variable until the environment variable is deleted again. They are not case-sensitive. While almost all such variables are prefixed with an underscore ("_") by 4DOS etc. by convention (f.e. %_SECOND%),[1] they are not under DR-DOS COMMAND.COM (f.e. %OS_VERSION%).

In addition, 4DOS, 4OS2, 4NT, and Take Command also support so called variable functions,[1] including user-definable ones. They work just like internal variables, but can take optional parameters (f.e. %@EVAL[]%) and may even change the system status depending on their function.

System information variables supported by DR-DOS COMMAND.COM:

除了真正的環境變量,這是靜態地存儲在環境中,直到改變或刪除,一些偽環境變量用於批處理存在。

所謂 替代參數可替換參數 (微軟/ IBM術語)又名 替換變量 (數字研究/ Novell公司/火山口術語)[5]批處理文件中的參數 (特軟件術語)[1] %1 .. %9% 0 可用於檢索batchjob的主叫參數見 移位。在batchjobs,它們可以檢索一樣的環境變量,但實際上並沒有存儲在環境中。

一些命令行處理器(如 DR-DOS COMMAND.COM[5] 多用戶DOS MDOS.COM / TMP.EXE,JP軟件 4DOS4OS24NT採取命令 和Windows CMD.EXE)支持一種類型的擬態環境命名變量 系統信息的變量(Novell公司/火山口的術語)[5]內部變量 (JP軟件的術語),[1] ,可用於檢索各種可能的動態,但只讀了有關系統運行批處理作業的信息。返回的值表示系統在這些變量查詢的時刻的狀態; 也就是說,閱讀他們多次在一排甚至可以在同一個命令返回不同的值; 查詢他們對系統沒有直接的影響。因為它們不是存儲在環境中,它們不被列出 SET,並且不用於外部程序來檢索存在。如果同一個名字的一個真實環境變量被定義,它的優先級高於相應的變量,直到環境變量被再次刪除。他們是不區分大小寫。雖然幾乎所有的這些變量的前綴為下劃線(“ _ “)由4DOS等按約定(FE %_SECOND% ),[1] 他們是不是在DR-DOS COMMAND.COM (FE %OS_VERSION% )。

此外,4DOS,4OS2,4NT,並以命令還支持所謂的 變量函數[1] ,包括用戶自定義的。他們的工作一樣 內部變量,但可以採取可選參數(FE %@ EVAL []% ),甚至可能改變根據它們的功能的系統狀態。

系統信息變量 通過DR-DOS支持 COMMAND.COM

%AM_PM%

This pseudo-variable returns the ante- or post-midday status of the current time. The returned string depends on the locale-specific version of DR-DOS, f.e. "am" or "pm" in the English version. It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回當前時間的產前或後午盤狀態。返回的字符串取決於DR-DOS,FE“的區域設置特定版本 “或” “的英文版本。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%DAY%

This pseudo-variable returns the days of the current date in a 2-digit format with leading zeros, f.e. "01".."31". See also the similar pseudo-variable %_DAY%. It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回一個2位數的格式前導零,FE“當前日期的天01 “” 31 “。也看到了類似的偽變量 %_day% 。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%DAY_OF_WEEK%

This pseudo-variable returns the day name of the week in a 3-character format. The returned string depends on the locale-specific version of DR-DOS, f.e. "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", or "Sat" in the English version. It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回在3字符格式的一周中的一天的名稱。返回的字符串取決於DR-DOS,FE“的區域特定版本的太陽 “,” 星期一 “,” 星期二 “,” 星期三 “,” 星期四 “,” 星期五 “,或” 週六在英國版本“。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%ERRORLEVEL%

In COMMAND.COM of DR-DOS 7.02 and higher, this pseudo-variable returns the last error level returned by an external program or the RETURN command, f.e. "0".."255". See also the identically named pseudo-variable %ERRORLEVEL% under Windows and theIF ERRORLEVEL command.

COMMAND.COM DR-DOS 7.02和更高的,這個偽變量返回由外部程序或返回的最後一個錯誤級別 返回 指令,FE“ 0 “” 255 “。也看到了相同名稱的偽變量 %ERRORLEVEL% Windows和下IF ERRORLEVEL 命令。

%ERRORLVL%

In Multiuser DOS as well as in DR-DOS 7.02 and higher, this pseudo-variable returns the last error level in a 3-digit format with leading zeros, f.e. "000".."255". See also the related pseudo-variable %ERRORLEVEL% under DR-DOS and the IF ERRORLEVELcommand.

多用戶DOS 以及在DR-DOS 7.02和更高的,這個偽變量返回的3位格式前導零的最後一個錯誤的水平,FE“ 000 “” 255 “。也看到了相關的偽變量 %ERRORLEVEL% 在DR-DOS和 IF ERRORLEVEL命令。

%GREETING_TIME%

This pseudo-variable returns the 3-level day greeting time. The returned string depends on the locale-specific version of DR-DOS, f.e. "morning", "afternoon", or "evening" in the English version. It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回的3級天問候時間。返回的字符串取決於DR-DOS,FE“的區域特定版本的早晨 “,” “,或” 晚上在英文版本“。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%HOUR%

This pseudo-variable returns the hours of the current time in 12-hour format without leading zeros, f.e. "1".."12". It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回當前時間以12小時格式的時間,沒有前導零,FE“ 1 “” 12 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%HOUR24%

This pseudo-variable returns the hours of the current time in 24-hour format in a 2-digit format with leading zeros, f.e. "00".."23". It resembles an identically named identifier variable in Novell NetWare login scripts. See also the similar pseudo-variable %_HOUR%.

這個偽變量返回當前時間以24小時格式小時的2位數字格式,前導零,FE“ 00 “” 23 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。也看到了類似的偽變量 %_HOUR%

%MINUTE%

This pseudo-variable returns the minutes of the current time in a 2-digit format with leading zeros, f.e "00".."59". It resembles an identically named identifier variable in Novell NetWare login scripts. See also the similar pseudo-variable %_MINUTE%.

這個偽變量返回的當前時間的分鐘的2位數字格式與前導零,FE“ 00 “..” 59 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。也看到了類似的偽變量 %_MINUTE%

%MONTH%

This pseudo-variable returns the months of the current date in a 2-digit format with leading zeros, f.e. "01".."12". It resembles an identically named identifier variable in Novell NetWare login scripts. See also the similar pseudo-variable %_MONTH%.

這個偽變量返回當前日期的月份在一個2位數的格式與前導零,FE“ 01 “..” 12 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。也看到了類似的偽變量 %_MONTH%

%MONTH_NAME%

This pseudo-variable returns the month name of the current date. The returned string depends on the locale-specific version of DR-DOS, f.e. "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", or "December" in the English version. It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回當前日期的月份名稱。返回的字符串取決於DR-DOS,FE“的區域特定版本的一月 “,” 二月 “,” “,” “,” “,” “,” “,” “,” 九月 “,” 十月 “,或” 十二月 “的英文版本。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%NDAY_OF_WEEK%

This pseudo-variable returns the number of day of the current week, f.e. "1".."7" (with "1" for Sunday). It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回當前星期,鐵的天數“ 1 “..” 7 “(與” 1 “為星期日)。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%OS_VERSION%

This pseudo-variable returns the version of the operating system depending on the current setting of the environment variable %VER%. If %VER% is not defined, %OS_VERSION% returns "off". It resembles an identically named identifier variable in Novell NetWare login scripts, which may return versions also for non-DR-DOS versions of DOS.

這個偽變量返回取決於環境變量的當前設定的操作系統的版本 %VER% 。如果 VER%% 沒有定義, %OS_VERSION% 的回報“ 關閉 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本,它可以返回版本也為DOS非DR-DOS版本。

%SECOND%

This pseudo-variable returns the seconds of the current time in a 2-digit format with leading zeros, f.e. "00".."59". It resembles an identically named identifier variable in Novell NetWare login scripts. See also the similar pseudo-variable %_SECOND%.

這個偽變量返回的當前時間的秒在一個2位數的格式與前導零,FE“ 00 “..” 59 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。也看到了類似的偽變量 %_SECOND%

%SHORT_YEAR%

This pseudo-variable returns the year of the current date in a 2-digit format with leading zeros, f.e. "93".."99", "00".."92". It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回當前日期在2位數的格式前導零的一年,FE“ 93 “” 99 “,” 00 “” 92 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%YEAR% and %_YEAR%

Supported since Novell DOS 7, the %YEAR% pseudo-variable returns the year of the current date in a 4-digit format, f.e. "1980".."2099". It resembles an identically named identifier variable in Novell NetWare login scripts. DR-DOS 7.02 and higher added%_YEAR% for compatibility with 4DOS, returning the same value.[1]

由於支持 的Novell DOS 7,在 %,比去年% 假變量返回當前日期的年份的4位數字格式,FE“ 1980年 “” 2099 “。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。DR-DOS 7.02和更高的附加​​%_YEAR% 與兼容 4DOS,返回相同的值。[1]

%/%

In COMMAND.COM of DR-DOS 7.02 and higher, this pseudo-variable returns the current SwitChar setting of the system, either "/" (DOS style) or "-" (Unix style).[8][9] See also the related CONFIG.SYS directive SWITCHAR and the environment variable%SWITCHAR%.

COMMAND.COM DR-DOS 7.02和更高的,這個偽變量返回當前 SwitChar 系統,無論是“的設定/ “(DOS樣式)或” - “。(Unix 的風格)[8] [9] 也見相關 CONFIG.SYS 指令 SWITCHAR 和環境變量%SWITCHAR%

%_CODEPAGE%

This pseudo-variable returns the systems' current code page ("1".."65533"), f.e. "437", "850", "858". This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the CHCP command.

這個偽變量返回系統的當前 代碼頁 (“ 1 “..” 65533 “),鐵” 437 “,” 850 “,” 858 “。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。又見 CHCP 命令。

%_COLUMNS%

This pseudo-variable returns the current number of screen columns depending on the display mode, f.e. "40", "80", "132", etc. This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also a similar environment variable %$WIDTH% under DOS Plus.

這個偽變量返回根據顯示模式,FE“屏幕列的當前數量40 “,” 80 “,” 132 “,等等。這個變量最初由引進 4DOS[1] 而且還成為可用 命令。 COM 由於DR-DOS 7.02。也看到了類似的環境變量 %$ WIDTH% DOS下的加分。

%_COUNTRY%

This pseudo-variable returns the systems' current country code ("1".."65534"), f.e. "1" for USA, "44" for UK, "49" for Germany, "20049" with ISO 8601, "21049" with ISO 8601 and Euro support. This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the CONFIG.SYS directive COUNTRY.

這個偽變量返回系統當前的 國家代碼 (“ 1 “..” 65534 “),FE” 1 “為美國,” 44 “為英國,” 49 “為德國,” 20049 “與 ISO 8601,“ 21049 “與ISO 8601和 歐元 的支持。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。又見 CONFIG.SYS 指令 國家

%_DAY%

This pseudo-variable returns the days of the current date without leading zeros, f.e. "1".."31". This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the similar pseudo-variable %DAY%.

這個偽變量返回當前日期的天,沒有前導零,FE“ 1 “” 31 “。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。也看到了類似的偽變量 %DAY%

%_HOUR%

This pseudo-variable returns the hours of the current time in 24-hour format without leading zeros, f.e. "0".."23". This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the similar pseudo-variable %HOUR24%.

這個偽變量返回當前時間在24小時格式的時間,沒有前導零,FE“ 0 “” 23 “。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。也看到了類似的偽變量 %HOUR24%

%_MINUTE%

This pseudo-variable returns the minutes of the current time without leading zeros, f.e "0".."59". This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the similar pseudo-variable%MINUTE%.

這個偽變量返回當前時間的分鐘數沒有前導零,FE“ 0 “” 59 “。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。也看到了類似的偽變量%MINUTE%

%_MONTH%

This pseudo-variable returns the months of the current date without leading zeros, f.e. "1".."12". This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the similar pseudo-variable%MONTH%.

這個偽變量返回當前日期的月份沒有前導零,FE“ 1 “” 12 “。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。也看到了類似的偽變量%,當月%

%_ROWS%

This pseudo-variable returns the current number of screen rows depending on the display mode, f.e. "25", "43", "50", etc. This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See a similar environment variable %$LENGTH% under DOS Plus.

這個偽變量返回根據顯示模式,FE“屏幕行目前一些25 “,” 43 “,” 50 “,等等。這個變量最初由引進 4DOS[1] 而且還成為可用 命令。 COM 由於DR-DOS 7.02。看到類似的環境變量 %$%長度 在DOS下加。

%_SECOND%

This pseudo-variable returns the seconds of the current time without leading zeros, f.e. "0".."59". This variable was originally introduced by 4DOS,[1] but also became available with COMMAND.COM since DR-DOS 7.02. See also the similar pseudo-variable%SECOND%.

這個偽變量返回當前時間的秒數沒有前導零,FE“ 0 “” 59 “。這個變量最初由引進 4DOS[1] 而且還成為可與 COMMAND.COM 因為DR-DOS 7.02。也看到了類似的偽變量%第二個%

System information variables supported by DR-DOS COMMAND.COM with networking loaded:

%LOGIN_NAME%

This pseudo-variable returns the user name. This always worked with NETX, but it will also work with Personal NetWare's ODI/VLM if the current drive is a PNW-mapped drive (otherwise an empty string is returned). See also the similarly named environment variable %LOGINNAME%.

這個偽變量返回的用戶名。這一直工作與 NETX,但它也將與 個人的NetWareODI / VLM 如果當前驅動器是一個PNW映射驅動器(否則一個空字符串返回)。也看到了類似命名的環境變量 %LOGINNAME%

%P_STATION%

This pseudo-variable returns the physical station number in a format "????????????". The value depends on the MAC address of the network adapter, but can be overridden. It resembles an identically named identifier variable in Novell NetWare login scripts.

這個偽變量返回的格式物理站號“ ???????????? “。的值依賴於 MAC地址 的網絡適配器,但可被覆蓋。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%STATION%

This pseudo-variable returns the logical station number starting with "1" for the first client. The numbers are assigned by the file server and remain static for as long as the IPX connection remains established. It resembles an identically named identifier variable inNovell NetWare login scripts.

這個偽變量返回以“邏輯站號1 “的第一個客戶。這些數字是由文件服務器分配並保持不變,只要在 IPX的 連接一直保持建立。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。

%FULL_NAME%

This pseudo-variable returns the full name of the logged in user, if available. It resembles an identically named identifier variable in Novell NetWare login scripts. See also the related pseudo-variable %LOGIN_NAME%.

這個偽變量返回的登錄的用戶,如果可用的全名。它類似於一個相同名稱 標識符變量的Novell NetWare 登錄腳本。也看到了相關的偽變量 %LOGIN_NAME%

Windows[edit]

Dynamic environment variables (also named internal variables or system information variables under DOS) are pseudo-environment variables supported by CMD when command-line extensions are enabled, and they expand to various discrete values whenever queried, that is, their values can change when queried multiple times even within the same command. While they can be used in batchjobs and at the prompt, they are not stored in the environment. Consequently, they are neither listed by SET nor do they exist for external programs to read. They are not case-sensitive.

Indirectly, they are also supported under Windows' COMMAND.COM, which has been modified to internally call CMD.EXE to execute the commands.

動態環境變量 (也稱為 內部變量系統信息的變量 的DOS下)是由支持偽環境變量 CMD 時被啟用命令行擴展,並且它們展開到每當查詢各種離散值,也就是,它們的值可以查詢時改變即使在同一個命令多次。雖然它們可以在batchjobs並在提示中使用,它們不存儲在環境中。因此,他們既不是上市 SET 也不外部程序的閱讀存在。他們是不區分大小寫。

間接的,他們也是在Windows的支持 COMMAND.COM,其中已被修改,以在內部調用 CMD.EXE 執行的命令。

%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.

這個偽變量擴展為當前等同於命令的輸出目錄 CD 時不帶參數調用。而長文件名 ​​可以在返回 CMD.EXE 根據當前目錄,一個事實,即當前目錄總是會在 8.3 格式下的 COMMAND.COM 將導致它在返回短文件名 ​​COMMAND.COM,即使 命令 內部調用 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 thatCOMMAND.COM calls CMD.EXE internally.

這個偽變量擴展到原來的啟動參數 CMD.EXE,FE“ C:\ WINDOWS \ SYSTEM32 \ cmd.exe的 “。在Windows的 COMMAND.COM,這可能會返回類似“ C:\ WINDOWS \ SYSTEM32 \ CMD.EXE / C ...... “由於該事實COMMAND.COM 調用 CMD.EXE 內部。

%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).

這個偽變量擴展到的命令行擴展的版本 CMD.EXE,如果啟用(如“ 1 “下 的Windows NT,“ 2 “下 的Windows 2000Windows 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.

這個偽變量擴展為最後一組誤差水平,之間“的值0 “和” 255 “(無前導零)。外部命令和一些內部命令設置在執行錯誤的水平。也看到了相同名稱的偽變量 %ERRORLEVEL%在DR-DOS和 IF ERRORLEVEL 命令。

%RANDOM%

This pseudo-variable returns a random number between "0" and "32767".

這個偽變量返回之間“的隨機數0 “和” 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.

這個偽變量返回當前時間。的時間是根據當前用戶的時間格式偏好顯示。如果 %TIME%%DATE% 變量都使用時,它讀取這些都在快速連續這個特定的順序,以避免午夜側翻問題是很重要的。

Critics[edit]

Some critics warn against overuse of environment variables, because of differences between shell languages, that they are ephemeral and easy to overlook, are specific to a user and not to a program. The recommended alternative is configuration files.[10][11]

一些批評者警告,因為外殼語言之間的差異對環境變量的過度使用,它們是短暫的,容易被人忽視,特定於用戶,而不是程序。推薦的另一種方法是 配置文件[10] [11]

See also[edit]