How To Use the PUSHD Command to Access a UNC Path at a Command Prompt in Windows 2000 (317379)



The information in this article applies to:

  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
  • Microsoft Windows 2000 Professional

This article was previously published under Q317379

SUMMARY

This article describes how to use the pushd command to gain access to a Universal Naming Convention (UNC) path at a command prompt.

You cannot change to a UNC path at a command prompt. However, you can use the pushd command to access a network path. If command extensions are enabled (this is the default in Windows 2000), the pushd command accepts network paths in addition to drive letters and paths. If you specify a network path, the pushd command creates a temporary drive letter that points to the network resource, and then changes the current drive and folder to the new drive letter. Temporary drive letters are allocated starting from Z and then backward through the alphabet, using the first unused drive letter found.

back to the top

How to Use the PUSHD Command

To use the pushd command, type the following line at a command prompt, where uncpath is the UNC path for the network share that you want to use:

pushd uncpath

For example, to connect to a share named Sharename on a server named Servername, type the following line, and then press ENTER:

pushd \\servername\sharename

The pushd command creates a temporary drive letter that points to the network share, and then changes the command prompt to that drive letter.

You can use the pushd command several times in one session. This creates a list (or "stack") of folders. You can type pushd with no path name to view the current state of the stack.

back to the top

How to Use the POPD Command

You can use the popd command to remove the top folder from the stack. The popd command returns you to the previous folder, and removes the temporary drive letter that was created by the pushd command.

The pushd and popd commands work together. The pushd command captures the name of the current folder. You can also add the name of a folder to which you want to change. For example, typing pushd \data1 switches you to the DATA1 folder, but remembers the name of the current folder. To return to this folder, type popd.

back to the top

Modification Type:MinorLast Reviewed:7/15/2004
Keywords:kbhowto kbHOWTOmaster KB317379 kbAudITPro