Skip navigation

Command Prompt Tricks

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.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish