TechRepublic : A ZDNet Tech Community

Microsoft Windows

Host: Mark Kaelin
Contact

Use the PushD command to create a quick temporary drive map in Windows XP

Have you ever been working from a Command Prompt and needed to temporarily map a drive letter to a network location for a quick file operation? Of course, you can switch over to Windows Explorer and use the Map Network Drive command on the Tools menu.

While this is a viable solution, it requires multiple steps to create and then you have to perform several more steps to disconnect the network drive. This can be a pain — especially if you just want to work from a Command Prompt.

However, there is another way. You can use the PushD command to quickly create a temporary drive map while remaining in the Command Prompt. You can then use PopD to quickly disconnect the network drive. Here’s how:

  1. Open a Command Prompt window.
  2. Type the following command line:
    PUSHD ServerSharepath

    where \\Server\Share\path is the network resource to which you want to map a drive letter.

As soon as you do, the PUSHD command will instantly map a drive letter to the network resource and then change to that drive right in the Command Prompt window. When you’re done, just type POPD and the mapped drive letter will be disconnected and you’ll return to your original drive.

Keep in mind that, the PUSHD command allocates drive letters from Z: on down and will use the first unused drive letter that it finds.

Note: This tip applies to both Windows XP Home and Windows XP Professional.

Miss a Windows XP tip?

Check out the Windows XP archive, and get more hands-on Windows XP tips.

Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!

Greg ShultzGreg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry. Read his full bio and profile.

Print/View all Posts Comments on this blog

Net Use mark.aggleton@... | 01/24/08
Hard to imagine a reason for this command davidp@... | 01/24/08
MESSAGE DELETED formerly CallPete.com | 01/24/08
Persistent switch Jim_MacLachlan | 01/24/08
Net Use is not persistent nzimmerman67 | 01/24/08
pete, thanks. Palmetto | 01/24/08
PUSHD SysAdminII | 01/30/08
PUSHD & Passing Credentials...Sadly, No Jeff Adams | 01/30/08
I use PushD and PopD LadyReader | 01/24/08
POPD is great for really quick access TheGooch1 | 01/24/08
Do you have script example? Photogenic Memory | 01/24/08
No searching involved techr@... | 01/24/08
I think it's intended to be a cd /d for UNCs g01d4 | 01/24/08
RE: Use the PushD command to create a quick temporary drive map alessandro.feltrin@... | 01/24/08
RE: Use the PushD command to create a quick temporary drive map Open Minded Geek | 01/24/08
RE: Use the PushD command to create a quick temporary drive map jakesty | 01/24/08
Not so open minded..! mike.england@... | 01/24/08
RE: Use the PushD command to create a quick temporary drive map mhmmd.faisal@... | 01/24/08
RE: Use the PushD command to create a quick temporary drive map pmuti@... | 01/24/08
RE: Use the PushD command to create a quick temporary drive map stuart.wood@... | 01/24/08
Drive shows in Windows Explorer also eblank@... | 01/24/08
Then jump from prompt to Win Explorer kunze@... | 01/25/08
PUSHD more functionality techr@... | 01/24/08
PUSHD / POPD -- Good old UNIX (also SUBST) timboid | 01/28/08
SUBST what a great command techr@... | 01/28/08
Wow! Great post!! Photogenic Memory | 01/28/08
PUSHD Using Local Paths Jeff Adams | 01/29/08
Working from the command prompt??? pethers | 01/24/08
RE: Working from the command prompt??? wiggledbits | 01/28/08
mouse is.. etkinsd@... | 01/28/08
RE: Good tip that has its place timothy.coe.sr@... | 01/24/08
Great Tip Solenade@... | 01/24/08
RE: Use the PushD command to create a quick temporary drive map James Jelinek | 01/26/08
indeed pmuti@... | 01/28/08
CMD does not support UNC... jk2001 | 01/28/08
UNC Path at the cmd prompt b.gallinger@... | 01/31/08
How to remove a Disconnected Network Drive that does not exist? ILUVIT | 05/27/08
Remove Disconnected Network Drive bgross@... | 05/30/08

What do you think?

White Papers, Webcasts, and Downloads

Recent Entries

TR on Twitter

Archives

TechRepublic Blogs



500 Things Every Technology Professional Needs to Know
Did you know Microsoft's RegClean does not work with XP but you can use shareware to clean your registry? Did you know most wireless access points don't have encryption enabled by default? Did you know there are 500 tidbits of information contained in TechRepublic's 500 Things Every Technology Professional Needs to Know that will help you become a successful IT professional.
Buy Now
IT Help Desk Survival Guide, Third Edition
TechRepublic's IT Help Desk Survival Guide, Third Edition provides tools and recommendations to help you better manage help desk services, improve end-user support, troubleshoot frustrating hardware issues, identify quick fixes to vexing Windows problems, and help users make the most of Microsoft Office 2003.
Buy Now

SmartPlanet

Click Here