{"id":1071,"date":"2021-06-15T09:44:32","date_gmt":"2021-06-15T01:44:32","guid":{"rendered":"https:\/\/wp.vicds.com\/?p=1071"},"modified":"2021-06-15T09:44:32","modified_gmt":"2021-06-15T01:44:32","slug":"%e5%be%ae%e8%bb%9f%e7%9a%84%ef%bc%85%ef%bc%85%e8%b7%af%e5%be%91","status":"publish","type":"post","link":"https:\/\/wp.vicds.com\/?p=1071","title":{"rendered":"\u5fae\u8edf\u7684\uff05\uff05\u8def\u5f91"},"content":{"rendered":"\n<p>\u53c3\u8003\u81ea <a rel=\"noreferrer noopener\" href=\"https:\/\/ss64.com\/nt\/syntax-variables.html\" target=\"_blank\">https:\/\/ss64.com\/nt\/syntax-variables.html<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Standard (built-in) Environment Variables<\/h2>\n\n\n\n<figure id=\"tbl\" class=\"wp-block-table\"><table><tbody><tr><th>Variable<\/th><th>Volatile<br>(Read-Only)<\/th><th>Default value assuming the system drive is C:<\/th><\/tr><tr><td>ALLUSERSPROFILE<\/td><td>&nbsp;<\/td><td>C:\\ProgramData<\/td><\/tr><tr><td>APPDATA<\/td><td>&nbsp;<\/td><td>C:\\Users\\<em>{username}<\/em>\\AppData\\Roaming<\/td><\/tr><tr><td>CD<\/td><td>Y<\/td><td>The current directory (string).<\/td><\/tr><tr><td>ClientName<\/td><td>Y<\/td><td>Terminal servers only &#8211; the ComputerName of a remote host.<\/td><\/tr><tr><td>CMDEXTVERSION<\/td><td>Y<\/td><td>The current Command Processor Extensions version number. (NT = &#8220;1&#8221;, Win2000+ = &#8220;2&#8221;.)<\/td><\/tr><tr><td>CMDCMDLINE<\/td><td>Y<\/td><td>The original command line that invoked the&nbsp;<a href=\"https:\/\/ss64.com\/nt\/cmd.html\">Command Processor<\/a>.<\/td><\/tr><tr><td>CommonProgramFiles<\/td><td>&nbsp;<\/td><td>C:\\Program Files\\Common Files<\/td><\/tr><tr><td>COMMONPROGRAMFILES(x86)<\/td><td>&nbsp;<\/td><td>C:\\Program Files (x86)\\Common Files<\/td><\/tr><tr><td>COMPUTERNAME<\/td><td>&nbsp;<\/td><td><em>{computername}<\/em><\/td><\/tr><tr><td>COMSPEC<\/td><td>&nbsp;<\/td><td>C:\\Windows\\System32\\cmd.exe or if running a 32 bit&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/WoW64\">WOW<\/a>&nbsp;&#8211; C:\\Windows\\SysWOW64\\cmd.exe<\/td><\/tr><tr><td>DATE<\/td><td>Y<\/td><td>The current date using same region specific format as&nbsp;<a href=\"https:\/\/ss64.com\/nt\/date.html\">DATE<\/a>.<\/td><\/tr><tr><td>ERRORLEVEL<\/td><td>Y<\/td><td>The current ERRORLEVEL value, automatically set when a program exits.<\/td><\/tr><tr><td>FPS_BROWSER_APP_PROFILE_STRING<br>FPS_BROWSER_USER_PROFILE_STRING<br><\/td><td>&nbsp;<\/td><td>Internet Explorer<br>Default<br>These are undocumented variables for the Edge browser in Windows 10.<\/td><\/tr><tr><td>HighestNumaNodeNumber<\/td><td>Y (hidden)<\/td><td>The highest&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-gb\/windows\/desktop\/ProcThread\/numa-support\">NUMA<\/a>&nbsp;node number on this computer.<\/td><\/tr><tr><td>HOMEDRIVE<\/td><td>Y<\/td><td>C:<\/td><\/tr><tr><td>HOMEPATH<\/td><td>Y<\/td><td>\\Users\\<em>{username}<\/em><\/td><\/tr><tr><td>LOCALAPPDATA<\/td><td>&nbsp;<\/td><td>C:\\Users\\<em>{username}<\/em>\\AppData\\Local<\/td><\/tr><tr><td>LOGONSERVER<\/td><td>&nbsp;<\/td><td>\\\\{domain_logon_server}<\/td><\/tr><tr><td>NUMBER_OF_PROCESSORS<\/td><td>Y<\/td><td>The Number of processors running on the machine.<\/td><\/tr><tr><td>OS<\/td><td>Y<\/td><td>Operating system on the user&#8217;s workstation.<\/td><\/tr><tr><td><a href=\"https:\/\/ss64.com\/nt\/path.html\">PATH<\/a><\/td><td>User and<br>System<\/td><td>C:\\Windows\\System32\\;C:\\Windows\\;C:\\Windows\\System32\\Wbem;<em>{plus program paths}<\/em><\/td><\/tr><tr><td>PATHEXT<\/td><td><\/td><td>.COM; .EXE; .BAT; .CMD; .VBS; .VBE; .JS ; .WSF; .WSH; .MSC<br>Determine the default executable file extensions to search for and use, and in which order, left to right.<br>The syntax is like the PATH variable &#8211; semicolon separators.<\/td><\/tr><tr><td>PROCESSOR_ARCHITECTURE<\/td><td>Y<\/td><td>AMD64\/IA64\/x86&nbsp;This doesn&#8217;t tell you the architecture of the processor but only of the current process, so it returns &#8220;x86&#8221; for a 32 bit&nbsp;<a href=\"https:\/\/en.wikipedia.org\/wiki\/WoW64\">WOW<\/a>&nbsp;process running on 64 bit Windows. See&nbsp;<a href=\"https:\/\/ss64.com\/nt\/syntax-64bit.html\">detecting OS 32\/64 bit<\/a><\/td><\/tr><tr><td>PROCESSOR_ARCHITEW6432<\/td><td>&nbsp;<\/td><td>=%PROCESSOR_ARCHITECTURE%&nbsp;(but only available to 64 bit processes)<\/td><\/tr><tr><td>PROCESSOR_IDENTIFIER<\/td><td>Y<\/td><td>Processor ID of the user&#8217;s workstation.<\/td><\/tr><tr><td>PROCESSOR_LEVEL<\/td><td>Y<\/td><td>Processor level of the user&#8217;s workstation.<\/td><\/tr><tr><td>PROCESSOR_REVISION<\/td><td>Y<\/td><td>Processor version of the user&#8217;s workstation.<\/td><\/tr><tr><td>ProgramW6432<\/td><td>&nbsp;<\/td><td>=%ProgramFiles%(but only available when running under a 64 bit OS)<\/td><\/tr><tr><td>ProgramData<\/td><td>&nbsp;<\/td><td>C:\\ProgramData<\/td><\/tr><tr><td>ProgramFiles<\/td><td>&nbsp;<\/td><td><a href=\"https:\/\/ss64.com\/nt\/syntax-64bit.html\">C:\\Program Files or C:\\Program Files (x86)<\/a><\/td><\/tr><tr><td>ProgramFiles(x86)&nbsp;<sup>1<\/sup><\/td><td>&nbsp;<\/td><td>C:\\Program Files (x86) &nbsp;&nbsp;(but only available when running under a 64 bit OS)<\/td><\/tr><tr><td>PROMPT<\/td><td>&nbsp;<\/td><td>Code for current command&nbsp;<a href=\"https:\/\/ss64.com\/nt\/prompt.html\">prompt<\/a>&nbsp;format,usually $P$G<br>C:&gt;<\/td><\/tr><tr><td>PSModulePath<\/td><td>&nbsp;<\/td><td>%SystemRoot%\\system32\\WindowsPowerShell\\v1.0\\Modules\\<\/td><\/tr><tr><td>Public<\/td><td>&nbsp;<\/td><td>C:\\Users\\Public<\/td><\/tr><tr><td><a href=\"https:\/\/ss64.com\/nt\/syntax-random.html\">RANDOM<\/a><\/td><td>Y<\/td><td>A random integer number, anything from 0 to 32,767 (inclusive).<\/td><\/tr><tr><td>%SessionName%<\/td><td>&nbsp;<\/td><td>Terminal servers only &#8211; for a terminal server session, SessionName is a combination of the connection name, followed by #S<em>essionNumber<\/em>. For a console session, SessionName returns &#8220;Console&#8221;.<\/td><\/tr><tr><td>SYSTEMDRIVE<\/td><td>&nbsp;<\/td><td>C:<\/td><\/tr><tr><td>SYSTEMROOT<\/td><td>&nbsp;<\/td><td>By default, Windows is installed to&nbsp;C:\\Windows&nbsp;but there&#8217;s no guarantee of that, Windows can be installed to a different folder, or a different drive letter.<br>systemroot&nbsp;is a read-only system variable that will resolve to the correct location.<br>Defaults in early Windows versions are&nbsp;C:\\WINNT, C:\\WINNT35&nbsp;and&nbsp;C:\\WTSRV<\/td><\/tr><tr><td>TEMP&nbsp;and&nbsp;<a href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=44213\">TMP<\/a><\/td><td>User Variable<\/td><td>C:\\Users\\<em>{Username}<\/em>\\AppData\\Local\\Temp<br>Under XP this was \\<em>{username}<\/em>\\<strong>Local Settings<\/strong>\\Temp<\/td><\/tr><tr><td>TIME<\/td><td>Y<\/td><td>The current time using same format as&nbsp;<a href=\"https:\/\/ss64.com\/nt\/time.html\">TIME<\/a>.<\/td><\/tr><tr><td><a href=\"https:\/\/blogs.msdn.microsoft.com\/tihot\/2004\/05\/28\/getting-the-dns-domain\/\">UserDnsDomain<\/a><\/td><td>Y<br>User Variable<\/td><td>Set if a user is a logged on to a domain and returns the fully qualified DNS domain that the currently logged on user&#8217;s account belongs to.<\/td><\/tr><tr><td>USERDOMAIN<\/td><td>&nbsp;<\/td><td>{userdomain}<\/td><\/tr><tr><td>USERDOMAIN_roamingprofile<\/td><td>&nbsp;<\/td><td>The user domain for RDS or standard roaming profile paths. Windows 8\/10\/2012 (or Windows 7\/2008 with&nbsp;<a href=\"https:\/\/support.microsoft.com\/en-us\/help\/2664408\/\">Q2664408<\/a>)<\/td><\/tr><tr><td>USERNAME<\/td><td>&nbsp;<\/td><td><em>{username}<\/em><\/td><\/tr><tr><td>USERPROFILE<\/td><td>&nbsp;<\/td><td>%SystemDrive%\\Users\\<em>{username}<\/em><br>This is equivalent to the&nbsp;$HOME&nbsp;environment variable in Unix\/Linux<\/td><\/tr><tr><td>WINDIR<\/td><td>&nbsp;<\/td><td>%windir% is a regular User variable and can be changed, which makes it less robust than %SystemRoot%<br>Set by default as windir=%SystemRoot%<br>%WinDir% pre-dates Windows NT, its use in many places has been replaced by the system variable: %SystemRoot%<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><sup>1<\/sup>&nbsp;Only on&nbsp;<a href=\"https:\/\/ss64.com\/nt\/syntax-64bit.html\">64 bit systems<\/a>, is used to store 32 bit programs.<\/p>\n\n\n\n<p>Unless stated otherwise, all the variables above are System variables<\/p>\n\n\n\n<p>Environment variables are stored in the registry:<\/p>\n\n\n\n<p>User Variables:&nbsp;HKEY_CURRENT_USER\\Environment<br>System Variables:&nbsp;HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment<\/p>\n\n\n\n<p>By default, files stored under&nbsp;<strong>Local Settings&nbsp;<\/strong>do not roam with a roaming profile.<\/p>\n\n\n\n<p>Dynamic environment variables are read-only and are computed each time the variable is expanded. When all variables are listed with SET, these will not appear in the list. Do not attempt to directly SET a dynamic variable.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Shell variables<\/h2>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Variables for current shell session are created with the&nbsp;<a href=\"https:\/\/ss64.com\/nt\/set.html\">SET<\/a>&nbsp;command and are available only to the current CMD shell. These are only stored in memory not the registry. Shell variables are destroyed when the current shell (CMD) exits.<\/p><p>Running the SET command with no options will display all shell variables but also all User and System environment variables.<\/p><p>If the SET command is used to modify the&nbsp;<a href=\"https:\/\/ss64.com\/nt\/path.html\">PATH<\/a>, or if it is removed completely with&nbsp;PATH ;&nbsp;that will not affect any other programs or CMD sessions opened before or after the current one.<\/p><\/blockquote>\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u53c3\u8003\u81ea https:\/\/ss64.com\/n [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1071","post","type-post","status-publish","format-standard","hentry","category-windows"],"_links":{"self":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts\/1071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1071"}],"version-history":[{"count":2,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions"}],"predecessor-version":[{"id":1073,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=\/wp\/v2\/posts\/1071\/revisions\/1073"}],"wp:attachment":[{"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.vicds.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}