问题描述
在Windows中是否有任何环境变量或其他格式的配置文件路径?我想以这样的方式查询:我应该得到值为C:\Documents和设置(如果Windows XP或2k3)或C:\users(如果vista或Windows 7)。
Is there any environment variable or Other format that the profile path is represented in Windows? I want to query in such a way that I should get the value "C:\Documents and Settings (if windows XP or 2k3) or C:\users (If vista or windows 7).
我不想将当前用户名附加到字符串,我可以通过%USERPROFILE%变量获取。
I dont want the current user name appended to the string, which I can get thru %USERPROFILE% variable.
推荐答案
不存在,而是尝试%USERPROFILE%\ ..
警告:@Mark建议,这不可靠,因为用户配置文件目录可能是任何任意位置。
Warning: as @Mark suggests, this is not reliable because the user profile directory may really be any arbitrary location.
这篇关于是否有任何环境变量表示“C:\Documents and Settings”文件夹或Windows中的C:\Users文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!