How can I configure my command prompt to display the machine name?
January 27, 2003
A. If you connect to multiple computers (e.g., by Telnet), you can configure the command prompt to display the name of the computer you're connected to. The best way to do this is to configure the command processor to automatically run a prompt command at startup to evaluate the %computername% environment variable. To configure the prompt, perform the following steps:
Start a registry editor (e.g., regedit.exe).
Navigate to the HKEY_LOCAL_MACHINESOFTWAREMicrosoftCommand Processor registry subkey (to configure the prompt for everyone) or to the HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor registry subkey (to configure the prompt only for the current user).
From the Edit menu, select New, String Value.
Enter a name of AutoRun, then press Enter.
Double-click the new value, set it to "prompt [%computername%]$S$P$G" (don't type the quotes), then press Enter.
Close the registry editor.
The change takes effect immediately. Your command prompt will now look like
[thunder] c:documents>
where "thunder" is the computer name. The registry setting passes the prompt command when each command session starts. The $S inserts a space, the $P specifies the drive and path, and the $G inserts the greater than (>) symbol. For other options, go to the command prompt and type
prompt /?
to view the Help menu.
About the Author
You May Also Like