Prompt can be made up of normal characters and the following special codes: If you execute the PROMPT command, it will set the PROMPT environment variable in your local context, so it will take an effect immediately, but until the console is closed only. If you can't do it for whatever reason, you can use the following method: 4. At least, you have to close and restart the application (console), so it loads the new or changed environment variable. Note: it's possible that you will have to reboot your system (or possibly just sign out and in) for the changes to take effect. For the current user, it's under the key HKEY_CURRENT_USER\Environment, and the system-wide one for all users under the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment.Ĭheck this page or other answers for details about the prompt format. In fact, both previous methods just create a string value named PROMPT in the registry. If you want to set it for all users, just add the /M switch: setx PROMPT /M Command-line methodĪnother way to set the PROMPT environment variable permanently is to use the SETX command: setx PROMPT You can see it with pictures in this article. A system variable will set it for all users. Simply press Win + Pause/Break (open System properties), click Advanced system settings, Environment variables and create a new user or system variable named PROMPT with the value set to whatever you want your prompt to look like. You can do it using two methods, GUI and command-line. It will work for any console window no matter how you open it. The advantage of this method is that you can easily set it system-wide and you don't need any scripts, edit the Windows Registry, etc. Another possibility is to set the PROMPT environment variable (which in fact is what the PROMPT command does).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |