[英]How can I change my windows display user name in command prompt?
I need to change my PC's cmd user name. 我需要更改我的PC的cmd用户名。 Is there any way to do that?
有没有办法做到这一点? Like currently in cmd I get
C:\\Users\\User Name>
But I want C:\\Users\\User_Name>
就像目前在cmd中我得到
C:\\Users\\User Name>
但我想要C:\\Users\\User_Name>
You can do it by using the command prompt
. 您可以使用命令
prompt
。 It would help if i could know what your username on windows is, but if we just say it is "User Name" we can craft a command. 如果我能知道你在Windows上的用户名是什么会有所帮助,但如果我们只是说它是“用户名”,我们就可以制作一个命令。
So we start with prompt $P
"$P" gives us the path so now our output is C:\\Users\\User Name
then we can add "$H" which is a backspace. 所以我们从
prompt $P
“$ P”开始给我们路径所以现在我们的输出是C:\\Users\\User Name
然后我们可以添加“$ H”这是一个退格。 So if we add 5 of those we can delete " Name". 因此,如果我们添加其中的5个,我们可以删除“名称”。 Now our command looks like this
prompt $P$H$H$H$H$H
and that will give us this output C:\\Users\\User
. 现在我们的命令看起来像这个
prompt $P$H$H$H$H$H
,这将给我们输出C:\\Users\\User
。 Now we just have to add the "_Name". 现在我们只需要添加“_Name”。 So now the command will look like this
prompt $P$H$H$H$H$H_Name
and we will have an output that looks like this C:\\Users\\User_Name
. 所以现在命令看起来像这个
prompt $P$H$H$H$H$H_Name
,我们将看到一个类似于C:\\Users\\User_Name
。 The last thing we have to add is the ">" at the end and you add that with "$G". 我们要添加的最后一件事是最后的“>”,你用“$ G”添加它。 Now we have our final command which is
prompt $P$H$H$H$H$H_Name$G
and will give us the output C:\\Users\\User_Name>
. 现在我们有了最后一个命令,即
prompt $P$H$H$H$H$H_Name$G
并将输出C:\\Users\\User_Name>
。 Try to see if you can craft your own command with your username. 尝试查看您是否可以使用您的用户名创建自己的命令。
To run the command every time you launch cmd you have to make a registry value in Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Command Processor
called "autorun" (type string) with your command as the value. 要在每次启动cmd时运行该命令,必须在
Computer\\HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Command Processor
名为“autorun”(类型字符串)的注册表值,并将您的命令作为值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.