Command Prompt Header

TUTORIAL: open a directory in Command prompt

Opening a directory with Command prompt could be useful for example: open a directory on a different computer or server. Or open a directory on a NAS for a back-up. This way you can program a script that will open this temporarily directory and write the back-up to this letter.

If you’re using this code line it will create a network drive with the last letter possible in the alphabet. So for me that’s Z:\. I’ll explain it in a short and longer(images) version.

Short | How to open a directory in Command prompt

  1. Open Command Prompt
  2. Type in: pushd \\hostname\directory
  3. Now you’ve created a temporarily network drive.

Long | How to open a directory in Command prompt

First you’ll have to open Command prompt:

opencmdNow we’ve opened command prompt(cmd) type in the following command line: Pushd \\hostname\directory. In the example below I used my own laptop as the host name and my user map as the directory.

lineincmdtemporarilydirectory

Now you’ll see a network drive with the last letter of the alphabet possible. For me that’s Z:.

If you’ve any questions regarding this topic comment or contact me and I’ll be happy to help you out.

Published by

Bas Wijdenes

My name is Bas Wijdenes and I work full-time as a Services Engineer. In my spare time I write about the error messages that I encounter during my work. Furthermore, I am currently occupied with Office 365, Azure infra, and PowerShell for automating daily tasks.

Leave a Reply

Your email address will not be published. Required fields are marked *