简体   繁体   English

如何在命令提示符下更改我的Windows显示用户名?

[英]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.

相关问题 如何更改 Windows 命令提示符中的文本颜色 - How can I change the text color in the windows command prompt 如何在Windows(7)命令提示符中导出命令的历史记录? - How I can export the history of my commands in Windows(7) Command Prompt? 如何更改 Windows 中的命令行提示符? - How do I change the command-line prompt in Windows? Windows命令提示符更改 - Windows Command Prompt Change 如何在命令提示符下查看我的SYSTEM环境变量? - How can I view my SYSTEM environment variables in a command prompt? 如何直接从 windows 运行提示符更改目录? - How can I change directory directly from the windows run prompt? 如何在 Windows 上将 GHCi 提示设置为 lambda 字符? - How can I set my GHCi prompt to a lambda character on Windows? 如何从我的应用程序中更改“使显示器变暗”和“使显示器亮度变暗”设置(Windows)? - How can I change the “Dim the display” and “Dimming display brightness” setting (Windows) from wihin my application? 如何更改Windows服务的名称? - How can I change the name of a windows service? 在Windows命令提示符下,如果没有输入,如何在一定时间内运行一个命令,如果没有输入,又如何运行? - In Windows Command prompt, how can I run one command if there is no input, and another if there is, within a certain time?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM