In cmd occasionally need to type certain commands in elevated privileges. How would you do this?
Run cmd as an administrator.
What is a keyboard shortcut for running cmd as admin?
Ctrl + Shift + Enter
What’s the cmd command to change directory?
cd or chdir
use a backslash to specify the volume or folder name
What’s the cmd command to list all the contents of a directory?
dir
What command in cmd can you use to list out details on how a command works?
help
i.e. help dir, help chkdsk, help sfc, etc… - you can also use [command] /? like: dir /?, chkdsk /?, sfc /?
Which cmd command can you type to navigate back one working directory?
cd { _ } ..
(2 dots/full-stops)
Which cmd command can be used to make a directory?
mkdir or md
Which cmd command can be used to change the directory you are in?
chdir or cd
Which cmd command can be used to remove/delete a directory?
rmdir or rd
Which key can you press in the Windows command prompt that autocompletes a word?
Tab
In MS Windows what is used in a filepath in place of a forward slash to separate the hight and lower level of the directory tree?
Backslash “ \ “
Which cmd command can be used to ensure that the files on a disk are ok (if using NTFS)?
chkdsk
When running the chkdsk command in cmd, what attribute should you also add that fixes the files after they are checked?
chkdsk /f
What security priviledge is needed to use the chkdsk /f command in cmd?
Admin
Run cmd as aministrator (Ctrl + Shift + Enter)
Which attribute of the cmd command “chkdsk” can be used to locate bad sectors of a drive and recovers readable information?
chkdsk /r
this implies /f
Which cmd command can be used to wipe a drive entriely and get a new and clear FS on it?
format
BE CAREFUL AS YOU CAN LOSE DATA! CREATE A BACKUP BEFORE! - do your backup of the whole system just in case you type an incorrect drive letter
Which cmd command can be used to manage the disk configurations in a Windows system?
DiskPart
The DiskPart utility in Windows requires which privileges to execute the command in cmd?
For most things you’ll need to “Run as administrator”
Which cmd command is used to duplicate a file?
copy
/v - verifies the new files are written correctly.
/y - suppresses prompting to confirm you want to overwrite an existing destination file.
What’s the syntax to use the cmd command “copy”?
copy file_name drive_letter
e.g. copy thedoes.pdf j:
The drive letter is for the destination of the copied file.
Use the cmd “copy” command to copy “jane.pdf” to the d drive
copy jane.pdf d:
Use the cmd “copy” command to copy “john.pdf” to the d drive
copy john.pdf d:
Which cmd command has been introduced in later versions Windows (10/11) that creates a “robust copy”?
robocopy
Why use “robocopy” instead of “copy”?
There are many more options available with “robocopy”