Don’t be careless with these commands! Practising deleting files directly from your C-drive might have disastrous consequences!
If you are studying IT at school, or are teaching yourself to program, you should learn to be comfortable working at the Windows Command Line Interface (“CLI”), commonly called the Windows Command prompt. Please be careful as this UI (“User Interface”) is not as forgiving as the Windows GUI (“Graphical User Interface”) you are accustomed to!
In this tutorial:
Required knowledge:
Why?
Considering that you will have no cute icons and shortcuts and the mouse will be sidelined, why would you bother learning endless commands and switches when a GUI is just so user-friendly?
- Fast performance: If you know how to use CLI and are familiar with different commands you will be able to complete many tasks faster than by using the GUI. You can perform multiple tasks by entering commands in the CLI.
- Less memory: The CLI uses less memory as compared to the GUI.
- Multitasking: CLI offers a great environment for multitasking.
- Control: CLI provides more control over the system than a GUI.
You can also write scripts to perform tasks that can even be scheduled as batch files.
Opening the CLI
Open up the Command Prompt now:
+ R
- type cmd
- Click the OK button

Your username will appear in place of the word in the screenshot above.
Extra skills
You can easily repeat commands once they have been executed using the ↑ & ↓ cursor keys to scroll through previously entered commands. You can auto-complete directory & file names using the TAB key.
Press the Enter key after typing each of the commands in the list below:
- Type dir to view the directory listing for the current directory
- Type cd Documents to change the directory to the Documents folder
- Type cd.. to move back up the hierarchy by one directory
- Type cd Doc and press the Tab key to autocomplete the name of the Documents folder to save you typing the full word
Commands you should know
cd
“change directory”
cd newdirectoryname
Change the command prompt to the new directory as specified by newdirectoryname
(changes the active directory on the same drive only [1])
cd \
Change the directory to the root.
cd ..
Change the directory one level up the directory hierarchy.
copy
copy filename newfilename
Makes a copy of the file named filename
and renames the copy to newfilename
.
cls
“clear screen”
Clears the Command Prompt window.
del
“delete”
del filename
Deletes the file as specified by filename
del foldername
Deletes a folder and everything inside it (after a confirmation prompt)!
dir
“directory”
Lists the contents of the current directory.


exit
Closes the Command Line window.
fc
“file compare”
fc file1 file2
Compares two files and displayed the differences as text.


help
help command
Displays help for the command specified.
ipconfig
“Internet Protocol configuration”
Displays the Internet Protocol (“IP”) information for your device.
ipconfig /release
ipconfig /renew
md
“make directory”
md mynewdirectoryname
Creates a new directory with the name specified by mynewdirectoryname
move
move C:\myfile.txt C:\myfolder\
Moves the file C:\myfile.txt
to a new location defined by C:\myfolder\
ping
ping ip
Sends messages to the specified IP address that are then echoed back by that host if it is available.
ren
“rename”
ren filename.txt newfilename.txt
ren foldername newfoldername


rem
“remove directory”
Deletes a directory.
type
type MyProgram.java
Displays the contents of a text file.
Java students only
java
java MyProgram
Runs the Java program named MyProgram.class
java -version

javac
“java compiler”
javac MyProgram.java
Compiles the program in the text file MyProgram.java
Totally random
gpupdate
“group policy update”
gpupdate
Schedules a Group Policy update.
gpupdate /force
Forces the Group Policy update to run immediately.
gpresult
gpresult /R
This command line tool displays the Resultant Set of Policy (“RSoP”) information for a target user and computer.
Next steps
- Learn to work with text files at the command line in the tutorial Editing at the command prompt.
- Head over to the “Hello World!” batch file tutorial.
References:
- Hello71 (2010) change directory command doesn’t work in windows command prompt, Super User. Available at: https://superuser.com/questions/165364/change-directory-command-doesnt-work-in-windows-command-prompt (Accessed: 16 January 2025).
- https://superuser.com/a/165368/469955
- Edwards, S. (2015). Windows Command Prompt Cheatsheet [PDF]. New York: Computer Science. Available at: http://www.cs.columbia.edu/~sedwards/classes/2015/1102-fall/Command%20Prompt%20Cheatsheet.pdf
- Jason Gerend. (n.d.). Windows commands. Available at: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands (Accessed: 2 February 2023).
- Gerend, J. (2023) Ping, Microsoft Learn. Available at: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/ping (Accessed: 28 August 2023).
- Gerend, J. (2023) gpresult, Microsoft Learn. Available at: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/gpresult (Accessed: 2 May 2024).