`
化蝶自在飞
  • 浏览: 2306909 次
  • 性别: Icon_minigender_2
  • 来自: 武汉
社区版块
存档分类
最新评论

说说windows下的系统变量 %windir% %userprofile%

阅读更多

接触过批处理文件的同志肯定有印象,那一串%开头结尾的单词到底什么意思呢?

目前windows xp系统的使用量还是很巨大的,我们就以xp为例说明.

系统文件盘为C盘,操作系统为Windows XP、登录用户名为k686、计算机名为k686.

 

%AllUsersProfile%

说明:所有用户的配置文件总目录

对应路径:C:\Documents and Settings\All Users

%USERPROFILE%

说明:指当前用户的配置文件目录

对应路径:C:\Documents and Settings\用户名

%HOMEPATH%

说明:指当前用户的配置文件目录

对应路径:C:\Documents and Settings\用户名

%systemdrive%

说明:系统所在盘

对应路径:C:\

%HOMEDRIVE%

说明:系统所在盘

对应路径:C:\

%windir%

说明:系统所在目录

对应路径:C:\WINDOWS

%SystemRoot%

说明:Windows所在目录

对应路径:C:\WINDOWS

%Temp%

说明:这个是系统的临时文件夹所在目录

对应路径:C:\Documents and Settings\用户名\Local Settings\Temp

%Tmp%

说明:这个是系统的临时文件夹所在目录

对应路径:C:\Documents and Settings\用户名\Local Settings\Temp

%ProgramFiles%

说明:Program Files程序安装目录

对应路径:C:\Program Files

%commonprogramfiles%

说明:Common Files目录

对应路径:C:\Program Files\Common Files

%APPDATA%

说明:Application Data目录

对应路径:C:\Documents and Settings\用户名\Application Data

%ComSpec%

说明:cmd.exe文件路径

对应路径:C:\WINDOWS\system32\cmd.exe

%LOGONSERVER%

说明:cmd.exe文件路径

对应路径:\k686

同时,以上变量设置还可以通过在CMD状态下输入set命令查看。而且可以在鼠标右键“我的电脑”,选择“系统属性-高级-系统变量”,在系统变量里手工可以添加变量

==================================================================================

%system%|%windows%|%userprofile%|%temp%的解释

手动查毒中,通常会看到%system% | %windows% | %userprofile% | %programfiles% | %commonprogramfiles% | %windir%等等用“%***%"来表示的路径的情况。这些变量让初级电脑用户和菜鸟在中毒后感到十分困惑和不解。

为方便大家看懂清除病毒过程步骤里的这些%***%变量,这里专门做一个简单的讲解和通用说明。不要因为它们看上去有很多种就觉得难,事实上,只要理解了一个其他就很容易掌握了。变量是由于操作系统或软件在不同的人的电脑中存放的位置可能是不同的,目录名称也可能是不一样的,所以用两个%%间加上特定名称的变量方式表达。只要你看得懂两个“%”间词语的意思,就非常好理解。

那么究竟什么是%system% | %windows% | %userprofile% | %programfiles% | %commonprogramfiles% | %windir%呢?


%Temp%——系统的临时文件夹所在目录,通常你的操作系统都是Windows,无论是 Win9X/2000/XP/2003/NT里的哪一种,只要你知道你把Windows系统装在哪个硬盘分区下就行了。比如说你装在C盘下,那么这里的%temp%就是指C:\Windows\temp这个目录文件夹。如果你把系统装在D盘,那么这时就变成D:\windows\temp了。

%windir%、%windows%表示windows所在目录,你的Windows装在哪个分区就指这个分区的windows文件夹。%Windows%在98及xp下指系统盘下的windows文件夹,2000下指WinNt文件夹。

%SystemRoot%、%system%是用来表示系统所在目录,分别指系统根目录和系统所在目录。其中%SystemRoot%如果操作系统为Windows并且装在分区C盘下,那么它们就是C:\windows。和第2条里的一样。

还有几个programfiles类的,如%USERPROFILE% 指当前用户的配置文件目录。%ProgramFiles% 指Program Files程序安装目录。%commonprogramfiles% 通用文件目录。


注意下%system%——

%System%在98下指windows\system,2000下指winnt\system32\,XP下指windows\system32文件夹

 

转载自新浪博客 blog.sina.com.cn/s/blog_3e8fafdc0100fw2v.html

分享到:
评论

相关推荐

    windir%_%userprofile%_XP下类似的变量的说明

    windir%_%userprofile%_XP下类似的变量的说明

    windows系统目录变量总结

     %windir% = %SystemRoot% = C:\WINDOWS 当前启动的系统的所在目录  %USERPROFILE% = C:\Documents and Settings\sihochina 当前用户数据变量 WINDOWS系统变量 桌面路径: echo %systemdrive%%homepath%\桌面 %...

    清除系统垃圾脚本批处理文件

    %windir%\temp & md %windir%\temp %userprofile%\cookies\*.* %userprofile%\recent\*.* "%userprofile%\Local Settings\Temporary Internet Files\*.*" "%userprofile%\Local Settings\Temp\*.*" "%user...

    windows10清理缓存

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...

    windowsxp系统清理代码

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\COOKIES s\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /...

    操作系统垃圾清理

    del f s q %windir% bak del f s q %windir% prefetch rd s q %windir% temp & md %windir% temp del f q %userprofile% cookies del f q %userprofile% recent del f s q "%userprofile% Local ...

    系统清理bat

    del f s q %windir% bak del f s q %windir% prefetch rd s q %windir% temp & md %windir% temp del f q %userprofile% cookies del f q %userprofile% recent del f s q "%userprofile% Local ...

    一键清理系统垃圾批处理

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...

    一键清除系统垃圾小程序

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /a/f/s/q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /a/f/s/q ...

    清除系统垃圾

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...

    一键清理系统

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...

    快速清理系统垃圾快速清理系统垃圾

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...

    清理系统垃圾文件的小方法

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\小甜饼s\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...

    C# 清理垃圾文件(最新)

    del /f /s /q "%windir%\Temp\*.*" echo C:\Documents and Settings\UserName\Local Settings\Temp del /f /s /q "%userprofile%\Local Settings\Temp\*.*" echo C:\Documents and Settings\UserName\Local Settings...

    一键清理系统垃圾文件

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...

    windows垃圾清除

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...

    清理系统垃圾文件,bat脚本实现

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f...

    清除系统垃圾 bat文件

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...

    清除系统垃圾文件

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q ...

    一键删除系统垃圾

    rd /s /q %windir%\temp & md %windir%\temp del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s ...

Global site tag (gtag.js) - Google Analytics