Skip to the content

How to open a folder in a DOS command prompt window

Last updated: By Lukas Brandt5 min read

Beige desktop tower with its side panel off and a small USB stick in a front port

Most command-line tools, from a firmware utility to a script someone handed you, expect to run from the folder they live in. Typing the full path every time gets old fast. Windows has several ways to open a prompt that is already in the right place, and real DOS on a boot stick has its own rules. One note on names first: the Command Prompt in Windows is cmd.exe, a Windows program that kept most of the DOS command syntax. People still call it the DOS prompt, and the second half of this page deals with the real thing.

The address bar shortcut

Open the folder in File Explorer, click the address bar (or press Alt+D), type cmd and press Enter. Command Prompt opens with that folder as its current directory. The same box accepts powershell for a PowerShell window, or this for Windows Terminal:

wt -d .

The -d option sets Terminal's starting directory, and the dot means the folder Explorer is showing.

Right-click menus in Windows 10 and 11

On Windows 10, hold Shift, right-click a folder (or empty space inside one) and choose Open PowerShell window here. That entry replaced the older Open command window here in the 2017 Creators Update. Type cmd in the PowerShell window if you want Command Prompt in the same folder.

On Windows 11, right-click a folder or empty space and choose Open in Terminal (older Terminal builds call it Open in Windows Terminal). It opens your default profile in that folder. If the default is PowerShell and you need cmd, type cmd there as well.

Already at a prompt: cd and cd /d

cd C:\Tools\flash
cd /d D:\BIOS
cd ..
cd \

The first line moves into a folder on the current drive, cd .. goes up one level and cd \ jumps to the root of the drive. The second line is the one people miss. cmd keeps a separate current folder for each drive, so typing cd D:\BIOS while you are on C: changes D:'s folder but leaves you on C:. The /d switch, per Microsoft's reference for cd, changes the drive and the folder together. Typing D: on its own line first does the same job in two moves.

Paths with spaces need care. cmd's cd accepts them without quotes when command extensions are on, which is the default, but most other commands do not, so quote out of habit:

cd /d "D:\BIOS files\G31 board"
dir "C:\Program Files"
"C:\Tools\My Tool\tool.exe" /?

To skip typing a long path, type cd /d and a space, then drag the folder from Explorer onto the console window. Windows pastes the full path, normally wrapped in quotes if it contains spaces. Press Enter. This does not work into a window started with Run as administrator, because Windows blocks drag and drop from a normal program into an administrator one. Going the other way is one command: start . opens Explorer on the current folder.

Network folders and pushd

cmd will not use a UNC path such as \\nas\files as its current directory. If you type cmd in the address bar while Explorer shows a network share, the prompt warns that UNC paths are not supported and starts in the Windows folder instead. Use pushd:

pushd \\nas\files\bios
dir
popd

Microsoft's documentation describes what happens: pushd temporarily assigns the highest unused drive letter, starting with Z:, to the share and changes to it. popd takes you back and removes that drive letter again.

PowerShell equivalents

In PowerShell, cd is an alias for Set-Location, and it changes drive and folder in one go, so cd D:\BIOS simply works. Do not add /d; PowerShell does not know the switch and stops with an error. It also accepts network paths directly (cd \\nas\files\bios), and pushd and popd are aliases for Push-Location and Pop-Location. Quote paths with spaces using single or double quotes.

One difference catches people: PowerShell does not run programs from the current folder by name. Type .\tool.exe, not tool.exe. Command Prompt runs either.

Parts links can earn us a commission. As an Amazon Associate I earn from qualifying purchases.

Real DOS on a boot stick

Some flash utilities for older boards run only under DOS. Rufus, the free USB tool, can build a FreeDOS boot stick, and its own page lists flashing a BIOS or other firmware from DOS among the reasons to use it. With the stick made, copy the board maker's utility and the BIOS file onto it from Windows, in the root or in a folder with a short name such as FLASH.

Drive letters

DOS gives letters only to partitions it can read: FAT12, FAT16 and FAT32 for FreeDOS. NTFS drives inside the PC do not appear at all, which is why the files have to sit on the stick. On most boards the stick boots as a hard disk and becomes C:. If dir on C: shows something else, try D: and E:.

Moving around

C:
dir /w
cd FLASH
dir /p
cd ..
cd \

Typing a letter and a colon switches drives. dir /w prints a wide listing with several names per line, and dir /p pauses after each screen. cd /d is a cmd.exe feature that classic MS-DOS does not have, so change drive first and then change folder; that order works in every DOS.

Short file names

DOS works with 8.3 names: up to eight characters, a dot and up to three more. A long Windows name such as Board BIOS 2301.ROM shows up under DOS as a generated short name like BOARDB~1.ROM, and some flash tools refuse names like that or misread them. Rename files to fit 8.3 in Windows before copying, for example BRD2301.ROM. To preview what DOS will see, run this in Command Prompt on the stick:

dir /x

Microsoft's dir reference describes /x as showing the short names generated for names that are not 8.3, printed before the long name.

The flashing itself, from saving the old image to reading the tool's switches, belongs to the board maker's readme and to our guides for AMI and Award or Phoenix BIOS images. Before you buy a chip that needs a newer BIOS, check the motherboard's CPU support list for the exact version. If a flash goes wrong anyway, reading the BIOS chip with a CH341A programmer is the usual way back, and for the operating systems those old boards suit, see running retro Windows on old hardware.

Headshot of Lukas Brandt
Lukas Brandt

Lukas keeps the web design corner: beginner HTML, CSS and JavaScript lessons with code you can paste and run. He also writes the general tech notes, usually after untangling something that should have been simple.