May 1, 2018

Network path in the command prompt

I spend a lot of time at the command prompt in Windows. I'm an old DOS guy, and frankly some things are easier at the command line than they are clicking and dragging things all over the place. While poking around the 'net, I came across a very helpful tip that will show you the UNC (\\server\directory) of the mapped network drive you are currently browsing. At the command prompt, type:
prompt $m$_$p$g
The $m echoes the Uniform Naming Convention (UNC) name of the drive letter that the command prompt currently displays;
the $_ inserts a carriage return and a line feed;
and $p$g are the standard drive and pathname with the greater-than symbol (>). This command caused the system to display the UNC name of network drives.
To make this change stick on a Win2K/XP system, you must modify/create an environment variable.
You do this by going to Control Panel, then System, then Advanced. From there, click the Environment Variables button, create a system variable named prompt, and set its value to $m$_$p$g. This will make the setting permanently display the remote network path every time you open a command prompt.

No comments:

Post a Comment