OwnVariables
Format:VariableName=ExpressionMeaning
---------------------------------------------------------------
%HomeDrive%=ThepartitionwhereWindowsiscurrentlystarted(usuallytherootdirectoryofthesystempartition,suchasC:\)
%SystemDrive%=thesameasthepreviousone
%SystemRoot%=TheinstallationdirectoryofthecurrentlystartedWindows(usuallytheWINDOWSfolderundertherootdirectoryofthesystempartition,suchasC:\WINDOWS)
Note:ThedirectoryunderWindows2000andearlierNTsystemsisunderX:\winntIfthesamesituationoccurs,nospecialexplanationwillbegiven.
%WinDir%=Samefunctionasthepreviousarticle
Important!Inthefollowing,Xrepresentsthesystemdriveletter
98representsa16-bit/32-bitdual-mixedWindowsseriesoperatingsystem,whichisdifferentfromtheWindowsNTsystem.IncludingWindows3.11,Windows3.2,Windows95,Windows95(1997),Windows98,Windows98SE,WindowsMillennium.
NTstandsforWindowsNT5.0andpreviousoperatingsystems,includingWindowsNT3.5,WindowsNT4.0Workstation,WindowsNT4.0Server,Windows2000Professional,Windows2000Server,Windows2000AdvancedServer,Windows2000Datacenter.
XPstandsforWindowsNT5.1andWindowsNT5.2operatingsystems.IncludingWindowsXPHomeEdition,WindowsXPProfessional,WindowsXPEmbedded,WindowsXP,WindowsServer2003StandardEdition,WindowsServer2003EnterpriseEdition,WindowsServer2003forSmallBusiness,WindowsServer2003Datacenter.
Win7standsforNT6andlateroperatingsystems,including:WindowsVistaStarter,WindowsVistaHomeEdition,WindowsVistaProfessional,WindowsVistaEnterprise,WindowsServer2008StandardEdition,WindowsServer2008EnterpriseEdition,WindowsServer2008Datacenter,Windows7Starter,Windows7HomeEdition,Windows7HomePremium,Windows7Professional,Windows7Ultimate,Windows8,Windows8Professional,Windows8MediaCenterProfessional,Windows8Enterpriseedition,WindowsServer2012andWindows8.1.
===============================================================================
%UserProFile%=currentuserDatafolder(usuallyunderXP/NT:"X:\DocumentsandSettings\UserName"underWin7:"X:\Users\UserName")
%HomePath%=Sameeffect
%Temp%=thecurrentuser’ssystemtemporaryfilefolder(usuallyunderXP/NT:"X:\DocumentsandSettings\username\LocalSettings\Temp".UnderWin7:"X:\Users\Username\AppData\Local\Temp")
%ProgramFiles%=Thedefaultinstallationdirectoryoftheapplication(usually"X:\ProgramFiles")
%ProgramFiles(x86)%=thedefaultinstallationdirectoryof32-bitapplicationsin64-bitoperatingsystems(usually"X:\ProgramFiles(x86)")
%CommonProgramFiles%=commonfiledirectory(usually"X:\ProgramFiles\CommonFiles")
%System%=System32directory(usuallyX:\WINDOWS\SYSTEM32)undertheWindowsinstallationdirectory(ie%SystemRoot%)
Note:%System%means"X:\Wndows\System"under98,"X:\WINNT\system32\"underNT,and"X:\WINDOWS\system32"underXP,thedefaultinWindows7Withoutthisvariable,youcanadditmanually
%Appdata%=Applicationdata(usuallyunderXP/NT:X:\DocumentsandSettings\Username\ApplicationData.UnderWin7:"X:\Users\Username\AppData\Roaming")
hint!Theuppercaseandlowercasecharactersofthestringbetween%%arefineandwillnotaffecttheuse.
Querysystemvariables
Ifthespecificmeaningofthesystemvariablesenclosedin%%isnotclear,youcanentertheoperation-entercmd-enterecho%variablenameunderthedoscommandline%Togettheanswer,enter"cdvariablename"tolocatethevariablelocation.Youcanalsoenterinthedoscommandline:"set"toviewallsystemvariablesandtheircorrespondinglocations.
Setsystemvariables
Thesystemadministratorcanopenthe“SystemVariables”iteminthe“Advanced”tabinthe“SystemProperties”settingtosetthesystemvariables.