Back
Close

Computing with Data

elgeish
158.5K views

Command Prompt - Introduction

To start Command Prompt, open the Start menu and search for cmd; the search results should contain an entry for Command Prompt.

rem This is a comment
rem The prefix ## indicates an output line
rem The echo command displays its arguments
echo hello world

rem Example: run multiple commands on the same line
echo hello & echo world

rem Example: the dir command
rem The current directory is C:\test
rem The "." entry is a reference to the current directory
rem The ".." entry is a reference to the parent directory
dir

rem Example: specifying options
rem Options are specified using a slash
rem The /b option instrcuts dir to use a bare format
dir /b

rem Example: combining options
rem The /a option instrcuts dir to show all contents
rem The /b option instrcuts dir to use a bare format
dir /a /b

rem Example: sorting the output of dir
rem The /a option instrcuts dir to show all contents
rem The /b option instrcuts dir to use a bare format
rem The /o:s option instrcuts dir to sort by file size
dir /a /b /o:s

rem Example: getting help
rem The /? option instrcuts tree to show its help message
tree /?
help help
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants