简体   繁体   English

运行命令转到用户的文档文件夹(类似于%appdata%)?

[英]Run command to go to user's documents folder (similar to %appdata%)?

Putting %appdata% into the run window will open up the Appdata folder, but what is the command to open the User's Documents folder, even when someone else logs in? 将%appdata%放入运行窗口将打开Appdata文件夹,但是即使其他人登录,打开User's Documents文件夹的命令是什么? I thought it was something like %userdir%, but I can not find out what it is. 我以为是%userdir%之类的东西,但是我找不到它是什么。 Not sure what to search for in Google either so I am at a loss. 也不确定在Google中搜索什么,所以我很茫然。

There is no environment variable for this. 没有为此的环境变量。 You'll need to set one. 您需要设置一个。 Here's a list of all Windows default environment variables: 以下是所有Windows默认环境变量的列表:

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds_shelloverview.mspx?mfr=true

*This is for XP, but should be the same for newer versions of Windows *这是针对XP的,但对于较新版本的Windows应该相同

For a single terminal session , you can just use 对于单个终端会话 ,您可以使用

set USERDOCS=%USERPROFILE%\Documents

For all terminal sessions , you'll need to set a system environment variable. 对于所有终端会话 ,您需要设置系统环境变量。 You can do this using the GUI or using setx -m USERDOCS %USERPROFILE\\Documents , as described here . 为此,可以使用GUI或用做setx -m USERDOCS %USERPROFILE\\Documents ,描述在这里

The command to make this happen would be 实现这一目标的命令是

explorer %USERDOCS%

But if you wanted to make an alias to that (ie a openuserdocs command), I can update and explain. 但是,如果您想对此做一个别名(即openuserdocs命令),我可以进行更新和解释。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM