Prompts in cmd are the text you type after the command line’s prompt symbol (usually C:\Users\YourName>) to tell Windows what to do. The prompt is simply the command interpreter’s way of saying “I’m ready for your next instruction.” You use it by typing a command and pressing Enter. The prompt itself is customizable, and knowing how to read and change it makes working in the command line much easier.
What the Prompt Symbol Means
The prompt you see when you open Command Prompt (cmd.exe) shows your current directory. By default, it looks like C:\Users\YourName>. The > symbol marks where your typed command begins. The text before it tells you where you are in the file system. For example, if you change to the Windows directory, the prompt becomes C:\Windows>. This is your visual cue that any command you type will run from that folder.
The prompt is not a command itself; it is the interface. You do not type the prompt. You type after it. If you see a prompt that looks different, such as # or $, you might be in a different shell like PowerShell or Git Bash, not cmd.
How to Change the Prompt Text
You can change what the prompt displays using the PROMPT command. This is useful if you want to see the current time, the drive letter, or a custom message. The command uses special codes that start with a dollar sign ($). Here are the most common ones:
$P– the current drive and path (e.g.,C:\Users)$G– the greater-than sign (>)$T– the current time$D– the current date$_– a new line$$– a dollar sign
To set a prompt that shows the time and a greater-than sign, type:
PROMPT $T$G
Your prompt will now show something like 14:23:45.12>. To go back to the default, type:
PROMPT
That resets it to the standard $P$G format. You can also set a permanent prompt by using the SETX command, but that is advanced and not needed for most tasks.
Common Prompt-Related Commands
Once you understand the prompt, the next step is knowing what to type. Here are the commands you will use most often, each with what it does and an example.
Change Directory: CD
To move to a different folder, type CD followed by the path. For example, to go into the Windows folder, type:
CD C:\Windows
To go up one level, type CD... To go to the root of the current drive, type CD\.
List Files: DIR
To see what is in the current folder, type DIR. It shows a list of files and subfolders, with their sizes and dates. To see hidden files, use DIR /A. To list only folders, use DIR /AD.
Clear the Screen: CLS
If the screen gets too cluttered, type CLS to clear it. The prompt returns to the top.
Copy Files: COPY
To copy a file from one place to another, use COPY. For example, to copy file.txt from the current folder to a folder called Backup on your D: drive, type:
COPY file.txt D:\Backup\
Move Files: MOVE
To move a file (cut and paste), use MOVE. The syntax is the same as COPY:
MOVE file.txt D:\Backup\
Delete Files: DEL
To delete a file, type DEL followed by the filename. Be careful; this does not send the file to the Recycle Bin. It is permanent.
DEL file.txt
Run a Program
If the program is in the current folder or in your PATH, you can just type its name. For example, to launch Notepad, type notepad and press Enter. To open a file with its default program, type the filename, like report.docx.
What to Do When the Prompt Doesn’t Respond
Sometimes you type a command and nothing seems to happen. This usually means one of a few things.
- You forgot spaces. Commands and their arguments must be separated by a space.
CD Windowsworks;CDWindowsdoes not. - The command is not recognized. If you see
'xyz' is not recognized as an internal or external command, you have a typo or the program is not in your PATH. Check the spelling. - The command is running but taking time. Some commands, like
DIRon a large folder, can take a few seconds. Wait before pressing Enter again. - You are in the wrong directory. If you try to run a file that is not in the current folder and not in PATH, it will not start. Use
CDto navigate to the correct folder first.
If a command seems to hang, you can press Ctrl+C to cancel it and get your prompt back. This is safe and does not harm your system.
Prompt Not Showing Your Current Folder
If your prompt always shows C:\Users\YourName> even after you change directories, you might have set a custom prompt that does not include $P. For example, if you typed PROMPT $G, your prompt is just > and it will not change. To fix this, reset the prompt by typing PROMPT (with no arguments) to return to the default $P$G.
Another reason could be that you are using a different shell. If you opened PowerShell, the prompt looks different and uses different commands. To open cmd specifically, press Win + R, type cmd, and press Enter.
Making a Custom Prompt That Stays
If you want a custom prompt every time you open cmd, you can set the PROMPT environment variable permanently. Use SETX PROMPT "$P$G" in the command line. Note that SETX affects new windows only; the current window keeps its old prompt. To test, close and reopen cmd.
Be careful with SETX; it writes to your user environment variables. If you set a prompt that includes special characters, you may need to escape them. For most users, the default prompt is fine, and a custom one is more of a personal preference than a necessity.
When the Prompt Shows an Administrator Prefix
If you open cmd as administrator, the prompt might show Administrator:C:\Windows\System32> or similar. That is normal. It just indicates that you have elevated privileges. Commands you run from that prompt have full system access, so be extra careful with DEL and FORMAT. You can still change directories and run commands as usual.
To tell if you are an administrator, look at the title bar of the window. It often says Administrator: Command Prompt. The prompt itself may or may not show it, depending on your Windows version and settings.
What to Do Next: Practice with Safe Commands
The best way to get comfortable with prompts is to practice. Open cmd and try these safe commands in order:
- Type
CLSto clear the screen. - Type
CD\to go to the root of C:. - Type
DIRto list the files there. - Type
CD Usersto go back to the Users folder. - Type
CD YourName(replace with your actual username) to return to your profile. - Type
PROMPT $D$Gto see the date in your prompt. - Type
PROMPTto reset it.
These commands do not change any files, so they are safe to try. As you get more confident, you can try COPY and MOVE on test files you create yourself. Always double-check the paths before pressing Enter, especially with DEL.
If you ever forget what a command does, type HELP to see a list of common commands, or type HELP CD for details on a specific one. The prompt is there to help you; it is not a test. You can always close the window and start over.
Related
- High Performance Mode via CMD Prompt
- What Are Some Prompts?
- Types of Writing Prompts and When to Use Each One
General information for everyday wellbeing, not medical advice. If something affects your health, sleep or mood for more than a short while, talk to a qualified professional. Read more
Spotted an error? Tell us and we will correct it (corrections policy).