keywords:
Bookmark and Share



Front Back
My first notecard
create more notecards
chkdsk
check disk for errors run with /F
diskpart
partition editing
format e:
formating tool

format a drive letter e
md
make directory
cd
change directory
rd
remove directory
ch ..
takes back one directory
dir
list files and directories in current directory
del
removes files from directory or disk aka erase
copy /a
copy and indicates a ASCII file
copy /v
copy and verifies new files are written correctly
copy /y
suppress prompting to confirm you want to overwrite an existing destination file
xcopy
copies files and directory trees

/s copies files and directories
robocopy
Robust Copy

a better xcopy
- included in windows resource kit
- not included in XP
- included in vista and 7
tasklist
displays list of currently running processes

local or remote machine
taskkill
terminate task by PID or Image name

ex: taskkill /pid 1140
SFC
scan integrity of all Protected system files
shutdown /s /t nn
wait nn seconds then shutdown
shutdown /r /t nn
wait nn seconds then shutdown and restart
shutdown /a
abort countdown
ver
displays the version of the operating system running on this computer, 
i.e. Microsft Windows Version 6.3.9600 (if the OS is Windows 8.1)
vol
Displays information about the current volume or you can specify the volumen you want information on.  
vol D:
returns volume letter, name and serial#
systeminfo
Returns detailed information about the computer including hostname, version, install date, last boot time, architecture, BIOS info including version and virtualization settings, hotfix info, domain membership, Windows directory information, Windows locale settings, memory stats, and pagefile location.
how can you find out information on a remote PC (i.e. hardware, software, and network information)?
systeminfo /S PCNAME /U DOMAINNAME/USERNAME /P PASSWORD

and use /FO to format as TABLE or LIST or CSV
List commands for customizing the CLI and what they do.
title - changes the title on the CLI window
color- changes the color of the text and background
cls- clears the screen
pause- stops the batch script from running until the user presses a key
prompt- customizes the CLI prompt to different characters or information, prompt followed by a comma returns the prompt to it's default setting
assoc
lists OS file associates (.txt=textfile)
you can also change file associations
assoc  .txt=notepad.exe
cipher
writes random data to a drive (more effective/secure than delete)
cipher /w:C (would overwrite all data on C with random data.
driverquery
gives detailed information about installed device drivers
fc
compares 2 files
fc "hello.txt" "hellowworld.txt"
fc "C:\Program Files (x86)\example1.doc" "C:\Program Files (x86)\example2.doc"
netstat
displays protocol statistics and current TCP/IP connections
-a all connections and listening ports
-n display in numerical form
-f displays FQDN
pathping
similar to tracert, relays path information along with ping test
tracert
pings target address and relays information about the path taken
powercfg
provides information on or modifies the power profile of the computer,
especially useful are /lastwake to display the last time the PC was woken from sleep, and /energy to generate a report on power cosumption and issues
sfc
system file checker, sfc /scannow will scan the integrity of all protected system files and replace incorrects with correct Microsoft versions.
recimg
updates your built in Windows Recovery Image
tasklist
shows all tasks/processes currently running on your PC,
tasklist -svc shows all services running
taskkill
terminates tasks by process ID or image name
taskkill -im notepad.exe /f
willl force all instances if image name notepad.exe to terminate and /f will force it to complete without interruption such as the "Do you want to save your work?" dialog.
dir
displays a list of folders and files in a directory
dir.. displays the dir of the parent directory
dir\ displays the dir of the root of the drive
cd
a command associated with change directory, displays the name of the current directory

explorer %cd%
opens windows explorer in the current directory
tree
displays the tree of folders and subfolder from the current directory
chdir
change directory, displays or changes the current directory
can be shorted to cd
cd displays current directory
cd C: changes current directory to C:
cd.. goes up one level
cd DIRECTORYNAME goes down one level if the directory is found in the current directory
type
displays the whole contents of a file
echo
writes lines of text to the CLI, a file, or as input for other commands
echo. will insert a blank line
&
continue to the next command
&& continue to the next command only if this command was successful
||
continue to the next command only if this command returns and error
^
carret is an escape character, if you wanted to display &, you could do so by running echo ^& or display ^ by running echo^^
x of y cards Next >|