Command Prompt Tricks
One reader shares his tip for setting up the command prompt to reflect a remote path.
January 16, 2001
If you're a frequent command prompt user, you'll appreciate the way this trick simplifies your life. This tip will work on all versions of Windows 2000 and Windows NT. By default, the prompt that the system presents you in a command prompt window shows the current drive letter and the full pathname. This prompt is configurable. For a list of configurable options, go to a command prompt and type
prompt /?
I spend much of my day dealing with remote file systems, so I often find myself wondering exactly where the J drive is mapped to. To refresh memory, I use the Net Use command. To modify the command prompt to reflect the remote path, I typed the following text at a command prompt
prompt $m$_$p$g
where $m echoes the Uniform Naming Convention (UNC) name of the drive letter that the command prompt currently displays; $_ inserts a carriage return and a line feed; and $p$g are the standard drive and pathname. This command caused the system to display the UNC name of my network drive.
To make this change stick on a Win2K system, you must modify an environment variable. You can do so from the Control Panel System applet's Advanced configuration option. All you have to do is click the Environment Variables button, create a system variable named prompt, and set its value to $m$_$p$g. This setting causes the system to display the remote network path every time you open a command prompt.
—Todd O. Klindt
[email protected]
About the Author
You May Also Like