Microsoft KB Archive/317379

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

Article ID: 317379

Article Last Modified on 10/31/2006

-

APPLIES TO


 * Microsoft Windows 2000 Server
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Professional Edition

-



This article was previously published under Q317379



IN THIS TASK
SUMMARY
 * How to Use the PUSHD Command
 * How to Use the POPD Command



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  is the UNC path for the network share that you want to use:

pushd

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 &quot;stack&quot;) 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

Keywords: kbhowto kbhowtomaster KB317379

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.