0% found this document useful (0 votes)
26 views29 pages

Windows Command Prompt CMD Cheat Sheet - The Hackr

The document provides an overview of the Command Prompt (cmd.exe) in Windows operating systems, detailing how to access it and a variety of basic and advanced commands. It includes commands for file management, directory navigation, and network configuration, as well as tips for modifying file associations and using environmental variables. Additionally, it describes function keys that enhance user interaction within the command line interface.

Uploaded by

faggotkilla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views29 pages

Windows Command Prompt CMD Cheat Sheet - The Hackr

The document provides an overview of the Command Prompt (cmd.exe) in Windows operating systems, detailing how to access it and a variety of basic and advanced commands. It includes commands for file management, directory navigation, and network configuration, as well as tips for modifying file associations and using environmental variables. Additionally, it describes function keys that enhance user interaction within the command line interface.

Uploaded by

faggotkilla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Command Prompt, also known as cmd.

exe or cmd (after its executable file name), is the

command-line interpreter on Windows NT, Windows CE, OS/2 and eComStation

operating systems. It is the counterpart of COMMAND.COM in DOS and Windows 9x

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
systems (where it is also called “MS-DOS Prompt”), and analogous to the Unix shells used

on Unix-like systems.

To open the Windows command prompt you may do one of the following:

Click Start -> Programs -> Accessories -> Command Prompt


Click Start (or hit the Windows key), type “cmd” in search, then
hit [ENTER]
Windows Key + R (#r, not the pound symbol) brings up Run. Then
type “cmd” then [ENTER]
SHIFT + right-click in any folder or desktop, then select “open
command window here”

BASIC COMMAND PROMPT COMMANDS

x /? = provides syntax info and complete list of all parameters


for x (a command, like “cd”)

cd = change directory

cd .. = move to the parent directory

cd\ = move to the root of current drive

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
cd x = move to the current\x directory

cd z: = change to the z root directory (as opposed to c:)

copy x y = copy file x to directory y (Ex: D:\games\galaga.exe


C:\programs[\awesome.exe]), [] = optional

copy file con = display file contents in console

copy con file.txt = create text file in the console window, end
with ctrl+z (^z or F6)

date = change the date

del = delete/erase

del x = deletes all files/folders fitting x

del . = deletes all files within current directory

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
del *.* = deletes all files within current directory

dir = display contents of current directory (Ex: dir [c:]


[\programs]), [] = optional

dir *.txt = list all .txt files in current directory

dir *.? = list all files with extensions one character in length
in current directory

dir /w /p *.* = display all contents one screen at a time

dir | more = display all contents one line at a time

dir /? = provides syntax info and complete list of all dir


parameters

echo = send command line input to display (by default)

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
echo sometext » somefile.txt = append line(s) of text to any
file

echo sometext > somefile.txt = overwrites file with sometext

erase = delete/erase

exit = exit the command prompt

filename.txt = opens filename.txt in current directory in


Notepad (or default .txt program)

format z: = format z drive [Ex: use to format a disc or flash


drive]

mkdir x = make directory x in current directory

move x y = more or rename x to y

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
q = escapes sequential display of contents (i.e. the more
parameter)

rd x = remove/delete directory x if it’s empty

ren x y = rename file x to y

time = change the time

type file = display the contents of the file ‘file’ (displays


file contents in console)

type file |more = display the contents one line at a time

ADVANCED COMMAND PROMPT COMMANDS

ipconfig [/all] = display network adapter information (advanced)

netstat –n = display local address and addresses you are


connected to (advanced)

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
netstat –nb = above with name of foreign addresses (advanced)
(this shows your private IP, if you are behind a router or proxy,
then your public IP address will be different)

ping google.com = how long it takes for your computer to talk to


google.com

CONVERT OUTPUT OF ONE PROCESS INTO INPUT OF


ANOTHER PROCESS

Send contents of script.js to the system debug.exe file:


type script.js | c:\programs]debug.exe
programs\debug.exe < script.js

SEND DIRECTORY LISTING TO A PRINTER OR FILE

dir > prn (theoretically to a printer)

dir > somefile.txt

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
dir *.mp3 > c:\Users\Dan\Desktop\musiclist.txt = print all .mp3
files in current directory to musiclist.txt

MODIFY ANY FILE EXTENSION ASSOCIATIONS

[assoc .extension=fileType]

assoc /? = prints this information

assoc = display list of current file extensions recognized by


your computer (any fileType value may be used)

assoc > fileextensions.txt = print list to somefile.txt in


current directory

assoc .txt = displays current file association of .txt (.docx,


.html, .zip, .htaccess, assoc textfile, et cetera)

assoc .txt= = will delete the association for the given file
extension

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
File Extension Tips/Ideas:
– Windows by default doesn’t know the following extensions, but check anyways with

“assoc .”, “assoc .htaccess” and “assoc .xml” anyways just to be sure. If the extension is

defined already, then you may not need to change it.

assoc .=txtfile = associate extensionless files with Notepad

assoc .htaccess=txtfile = associate nameless .htaccess files with


Notepad

assoc .xml=txtfile = associate XML files with Notepad

ENVIRONMENTAL VARIABLES VIA THE DOS COMMAND


PROMPT

System-generated upon Windows startup:

%DATE% = Tue 08/02/2011


%TIME% = 14:23:33.37
%SYSTEMROOT% = C:\Windows
%COMPUTERNAME% = DAN-PC

System-generated upon user login:

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
%USERNAME% = Dan
%USERDOMAIN% = Dan-PC

Local machine variables for all users:

%PATH% = C:\Windows\system32
%HOMEPATH% = \Users\Dan
%HOMEDRIVE% = C:

(Hint: Use echo)

FUNCTION KEYS

F1 = Sequential, individual repeat of previously entered


characters

F2 = Copies any number of characters from the previous command


line

F3 = Repeats the contents of the previous command line

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
F4 = Deletes any number of characters from the previous command
line

F5 = Return to the previous command line

F6 = Enters the characters ^z (CTRL+z), indicating “end of file”

F7 = Displays a history of command-line entries for the current


session (50-line cache)

F8 = Sequentially displays previous command-line entries

F9 = Enables user to recall previous command lines by number (0 =


first line)

crunches

Sreehas

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
The hacking trend these days has definitely turned criminal because of e-

commerce ¯\_( ツ )_/ ¯

VIEW ALL POSTS  

Cracking WPA2-PSK Passwords 


Linux Terminal Cheat Sheet

Using Aircrack-ng

0 Comments The Hackr 


1 Login

Sort by Best
 Recommend ⤤ Share

Start the discussion…

LOG IN WITH
OR SIGN UP WITH DISQUS ?

Name

Be the first to comment.

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
ALSO ON THE HACKR

Encrypt and Decrypt Images Using Hack any Android and get Root
Python access in 20 Seconds
1 comment • a year ago 2 comments • a year ago
MELIODASL — Dude can you make a Ada Csaba — great article though i
video I seem to be facing problem have a question, did you *actually* try
running the program this , or better try this to understand

How to Hack Facebook in 2017 How To Enable USB “Security Key”


1 comment • a year ago Authentication On Facebook
S.K. Bharati — Best Information. If 2 comments • a year ago
anyone having trouble then read all thehackrthehackr — test
hacking tricks in Hindi at

✉ Subscribe d Add Disqus to your site 🔒 Disqus' Privacy Policy

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
You may also like

FORENSICS HOW TO KALI

Find Critical Information


about a Host using
DMitry
Deepmagic Information Gathering Tool

otherwise called Dmitry is a...

Sreehas  190 views

Sreehas  701 views

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
HOW TO WINDOWS FOR HACKING

Create a Backdoor Trojan


Using Beast
‘Beast’ is a Windows based backdoor trojan

horse, commonly known as “RAT” or

Remote Administration Tool. It is written...

HOW TO WINDOWS FOR HACKING

Build a Computer Virus


Using TeraBIT
Ever wondered how to build a Computer

Virus! A computer virus is basically a

malware that, when executed, replicates

itself by...

Sreehas  297 views

We Got You
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
0-day exploit 1

Android 5

Cracking WEP 1

DDoS Attack 1

dirty-cow exploit 2

DoS Attacks 1

Everything Else 9

Exploits 8

Forensics 7

Social Engineering 1

Recent Posts  

Find Critical
Information about a
Host using DMitry
Sreehas
 10 months ago

Create a Backdoor

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Trojan Using Beast
Sreehas
 10 months ago

Build a Computer Virus


Using TeraBIT
Sreehas
 10 months ago

How to Archive and


Compress Data in Linux
Sreehas
 May 9, 2017

Reveal Saved
Passwords in Browser
using JavaScript
Injection
Sreehas
 May 4, 2017

How To See Saved


Passwords Under
Asterisks In Browsers
Sreehas
 May 4, 2017

Crack SSH, FTP, Telnet


Logins Using Hydra
Sreehas
 April 4, 2017

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Search
Type here to search...

SEARCH

Chat With Our Bot

IntroducingTheHackr Chatbot,now

anyone can interact with our messenger

bot and get daily crunches about Cyber-

Security in just a clicks away!

 

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
Get to know us We are social
Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD
About Us Facebook

Careers Twitter

Press Releases Instagram

sitemap;xml sitemap Yandex

Let us help you Join us

thehackr bot Become an Author

facebook.com/hackr79 Advertise your Products

twitter.com/thehackr79 Contribute

plus.google.com/hackr79

Copyright © 2016 · Made with in India

Create PDF in your applications with the Pdfcrowd HTML to PDF API PDFCROWD

You might also like