190 likes | 208 Views
Command LINE BASICS. EXAM 902 1.3 Given a scenario, apply appropriate Microsoft command line tools 4.1 Given a scenario, troubleshoot PC operating system problems with appropriate tools. Command Prompt.
E N D
Command LINE BASICS EXAM 902 1.3 Given a scenario, apply appropriate Microsoft command line tools 4.1 Given a scenario, troubleshoot PC operating system problems with appropriate tools
Command Prompt • In many cases its more efficient to manipulate files and folders using commands in a command prompt window than using Windows Explorer • In some troubleshooting situations, you have no other option but to use the command prompt window • The next section covers using basic commands at the command prompt
Command Prompt prompt • Open a command prompt window by clicking the start button, then enter cmd in the search box, and press enter • At the command prompt, you enter commands to perform a variety of tasks • Windows has 2 levels of command prompt windows, a standard window and an elevated window
Standard vs Elevated Windows • The Standard window opens by default and will show the directory of the currently logged on user’s folder • Commands requiring administrative privileges will not work in a standard window • The Elevated window requires the user to logon as an administrator or enter an admin password • The word “administrator” will appear in the title bar • The default directory will be: C:\Windows\system32
Windows Vista or 7 An elevated command prompt window (indicated by “administrator” in the title bar) has administrative privileges In Windows 8 or 10
5 Command Prompt Tips • The following 5 Tips will help you with working in a command prompt window: • Tip 5: Type exit and press Enter to close the window • Tip 1: Type cls and press Enter to clear the window • Tip 2: Press the up arrow to retrieve the last command that you entered • Tip 4: Press Ctrl+Break or Ctrl+Pause to terminate or pause a command before it is finished • Tip 3: Press the right arrow to retrieve the last command one character at a time
use thehelp command to get help with any other command and to list all available commands HELP command and results
xcopy /s ping -t Switches chkdsk /f /r • Many commands can use parameters (more commonly called switches) • Switches effect how the command will work • Switches often begin with a slash followed by a single character • For example the “dir” command can be used with the “/p” switch to list files and directories one screen at a time • So you would enter “dir /p” (without quotations) at the command prompt
DIR A*.??? Wildcards • When working at the command prompt you can use wildcard characters to apply a command to a group of files • You can also use them to abbreviate a filename if you don’t know the entire name • The question mark (?) is a wildcard for one character • The asterisk (*) is a wildcard for one or more characters • For example to find all files in a folder that start with “A” and have a 3 letter file extension, use the following command: ? *
use the dir command to display a list of files and folders • The Dir command is used to list files and directories DIR command and results
Use the Cd command to: change the current default directory Use the Rd command to: remove a directory (empty) Use the Mdcommand to: create a directory Folder Commands
File Commands Use the DEL command (or Erase command) to: delete one or more files Use the REN command to: rename a file or group of files
Copy, Xcopy, &Robocopy CommandsComparison • COPY • The copy commandcopies a single file or group of files • Example: To copy myfile.txt from drive C: to drive E:, use the following command: C:\>copy myfile.txt E: • XCOPY • The xcopy commanduses the same format as the copy command but it is more powerful • ROBOCOPY (robust file copy) • The robocopy command is more powerful than xcopy • Ability to tolerate network interruptions and resume copying
Disk Commands Chkdsk Command • fixes file system errors and recovers data from bad sectors on the drive • The chkdsk command • Used with the /F switch, chkdsk searches for and fixes two types of file system errors • Lost Clusters are clusters marked as used but does not belong to any file; the data in these clusters is lost • Cross Linked Clusters are clusters that are marked as belonging to more than one file • chkdsk looks for lost clusters and cross linked clusters and bad sectors • Used with the /R switch
use thedefrag command to examine a drive for fragmented files and rewrite them in contiguous clusters DEFRAG command and results
use theformat command to perform a high level format on a hard drive or other storage device Format Command FORMAT command and results
use theshutdown command to shutdown the local computer or a remote computer SHUTDOWN command and results