programming
DESCRIPTION
Introduction to Computer ProgrammingTRANSCRIPT
![Page 1: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/1.jpg)
PROGRAMMING INTRODUCTION
MS DOS COMMAND
![Page 2: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/2.jpg)
What is DOS?
Short for Microsoft Disk Operating System, MS-DOS is a non-graphical command line operating system derived from 86-DOS that was created for IBM compatible computers. MS-DOS originally written by Tim Paterson and introduced by Microsoft in August 1981and was last updated in 1994 when MS-DOS 6.22 was released.
![Page 3: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/3.jpg)
Today, MS-DOS is no longer used; however, the command shell, more commonly known as the Windows command line is still used by many users. In the picture to the right, is an example of what a MS-DOS window more appropriately referred to as the Windows command line looks like under Microsoft Windows.
![Page 4: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/4.jpg)
WHAT WILL YOU LEARN?
![Page 5: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/5.jpg)
1. How to Hide or Dismount a Partition in Windows
2. An Ode to the Command Prompt - the Most Powerful and Least Used Windows Tool
3. Fix Issues with your Boot Records
4. Repair Missing or Corrupt Files
5. Advanced Commands for System Information & Managing Active Tasks
6. Advanced Disk Management Commands
7. Advance Networking Commands
8. How to use Basic Commands9. How to Customize the Command Prompt
![Page 6: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/6.jpg)
HOW TO OPEN COMMAND PROMPT IN
WINDOWS 7 AND WINDOWS 8
![Page 7: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/7.jpg)
1. Launch the Command Prompt Using Search.Search is very helpful, both in Windows 7 and Windows 8. In Windows 7, open the Start Menu and type command or cmd.
Then, click the Command Prompt search result.
![Page 8: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/8.jpg)
2. Launch it from the Run WindowOne of the quickest ways to launch the Command Prompt is to use the Run window (press Win+Ron your keyboard to open it).Then, type cmd or cmd.exe and press Enter or click/tap OK.
![Page 9: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/9.jpg)
3. Launch it from the Start Menu/ScreenIf you like clicking on stuff and you are using Windows 7, open the Start Menu. Then, go to All Programs -> Accessories.
There you will find the Command Prompt shortcut.
![Page 10: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/10.jpg)
4. Create a Command Prompt Shortcut on the Desktop If you prefer using your own shortcuts, then don’t hesitate to create a shortcut to the Command Prompt.
![Page 11: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/11.jpg)
5. Pin it to the Start Menu/Screen or the TaskbarIf you would rather have a clean Desktop, you might want to pin the Command Prompt to the taskbar, the Start Menu (in Windows 7) or to the Start screen (in Windows 8).
![Page 12: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/12.jpg)
6. Launch it from Windows/File ExplorerLast but not least, you can open Windows Explorer (in Windows 7) or File Explorer (in Windows 8). Then, open the partition where Windows is installed and browse to Windows -> System32.
![Page 13: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/13.jpg)
![Page 14: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/14.jpg)
HOW TO CUSTOMIZE THE
COMMAND PROMPT
![Page 15: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/15.jpg)
![Page 16: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/16.jpg)
WHAT IS COMMAND PROMPT?
Before Windows came into the picture, the most common operating system was DOS (Disk Operating System). It was a text-based operating system, that enabled you to run programs by manually typing in commands. The launch of the Windows operating system simplified the whole computing experience by making it more visual. Even though DOS has not been included in Windows operating systems for years, there still is the Command Prompt - the text command-line interpreter, analog of the command shell of its old DOS ancestor.
![Page 17: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/17.jpg)
• This tool is generally used by more advanced users such as system administrators to run commands which might not be triggered from the visual interface of Windows.
• Even though it may look a bit unfriendly, it does not mean that you cannot learn how to use it. If you will follow our mini-series you will see that this tool is useful and can be used by anyone.
![Page 18: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/18.jpg)
ACCESS THE PROPERTIES OF THE COMMAND
PROMPT
![Page 19: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/19.jpg)
To access the properties of the Command Prompt and customize them, right click on its window and select Properties.
![Page 20: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/20.jpg)
You will notice four tabs with options that can be configured: Options, Font, Layout and Colors.
![Page 21: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/21.jpg)
CUSTOMIZE THE COMMAND PROMPT
CURSOR SIZE, BUFFERS AND EDIT
MODES
![Page 22: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/22.jpg)
First, you have the Options tab. It has three sections: Cursor Size, Command History and Edit Options.
![Page 23: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/23.jpg)
For the cursor you can choose its size by using one of the available options: Small, Medium or Large.
Command History area you can customize how many commands are retained in the buffer.
The buffer serves as a historical record of the commands you have run and you can use the up and down arrow keys to navigate through the previously entered commands.
![Page 24: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/24.jpg)
'Number of Buffers' determines for how many concurrent instances of the Command Prompt you’re having separate buffers created.
'Discard Old Duplicates', allows Windows to remove duplicate command entries from the buffer.
Edit Options area you have only two options: Quick Edit Mode and Insert Mode.
![Page 25: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/25.jpg)
A sample of how Quick Edit Mode works can be viewed in the capture below. With the mouse, I selected the text for copying. I pressed Enter and the text was copied to the clipboard.
![Page 26: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/26.jpg)
ADJUST THE FONT IN THE COMAMND
PROMPT
![Page 27: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/27.jpg)
In the Font tab you will be able to select the Font size and Font Type. Also, you can use the preview window to see the effect of your settings before applying them.
![Page 28: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/28.jpg)
CHANGE THE COMMAND
PROMPT WINDOW SIZE
![Page 29: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/29.jpg)
The Layout tab has three simple sections where you can configure the size of the Command Prompt window and of the lines of text within it.
The available options are as follows:• 'Screen Buffer Size' - allows you to configure
the number of characters that are displayed on a line in the Command Prompt window. This is achieved by adjusting the Width value, and the number of lines that are stored in memory, by adjusting the Height value;
![Page 30: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/30.jpg)
• 'Window Size' - allows you to select the Width and Height of the window.
• 'Window Position' - enables you to configure the Command Prompt's window distance from the left and top edges of the screen. This option works only if the 'Let System Position Window' check box is not checked.
• 'Let System Position Window' - if it's checked, you won’t be able to configure the window position settings.
![Page 31: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/31.jpg)
![Page 32: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/32.jpg)
HOW TO SET THE COMMAND
PROMPT WINDOWS
![Page 33: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/33.jpg)
• The Colors tab is easy to configure. There are four items that can be customized:
• Screen Text - allows you to set the color of the text displayed in the Command Prompt window;
• Screen Background - enables you to choose the background color of the Command Prompt window;
• Popup Text - allows you to set the color of the text displayed in a pop-up window;
• Popup Background - permits you to set the background color of a pop-up window.
![Page 34: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/34.jpg)
![Page 35: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/35.jpg)
![Page 36: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/36.jpg)
HOW TO USE THE BASIC COMAMNDS
IN COMMAND PROMPT
![Page 37: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/37.jpg)
HOW TO NAVIGATE BETWEEN FOLDERS
The first command from the list is CD (Change Directory). This command enables you to change the current directory (or folder).
The command CD\ takes you to the top of the directory tree.
![Page 38: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/38.jpg)
![Page 39: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/39.jpg)
Now you are working on the 'C:' drive. If you need to go to a specific folder from this drive just type CD DIRECTORYNAME. The subdirectory names are separated by \.
For example when you need to access the System32 folder that is located on 'C:\Windows' just type cd windows\system32\, and then press Enter.
![Page 40: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/40.jpg)
![Page 41: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/41.jpg)
When you need to go to one folder up, use the cd.. command. Let's assume that you want to go back to the Windows folder. Type cd.. and press Enter. You will notice that your current directory has changed to 'C:\Windows'.
![Page 42: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/42.jpg)
HOW TO ACCESS A CERTAIN DRIVE
![Page 43: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/43.jpg)
To access another drive just type the drive letter followed by ':'. For example, we wanted to change the drive from 'C:' to 'D:'. We have typed d: and then pressed Enter.
![Page 44: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/44.jpg)
To change the drive and the directory at the same time, use the cd command followed by the /dswitch. The parameter is used to change the current drive to a specific folder from other partition. For example, now you are on the 'D:' drive and you want to go back to the 'C:' drive directly to the Windows folder. Type cd/d C:\Windows and press Enter, as you can see in the following image.
![Page 45: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/45.jpg)
![Page 46: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/46.jpg)
HOW TO VIEW THE CONTENT OF A FOLDER
![Page 47: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/47.jpg)
You can view the content of a folder by using a simple command called DIR.
![Page 48: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/48.jpg)
![Page 49: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/49.jpg)
HOW TO CREATE A FOLDER USING THE COMMAND
PROMPT
![Page 50: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/50.jpg)
You can make a new directory using the MKDIR (Make Directory) command. The syntax of this command is MKDIR directory name.
Let's say we need to create a new folder called 7tutorials_v1 that will be placed in the'd:\7tutorials' folder. We will type mkdir 7tutorials_v1 and then we press Enter.
![Page 51: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/51.jpg)
![Page 52: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/52.jpg)
HOW TO RENAME FILES AND FOLDERS
![Page 53: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/53.jpg)
To test if it worked, we will use again the dir command. The newly created folder appears in the list.
![Page 54: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/54.jpg)
To rename files and folders you need to use the REN (Rename) command.
For folders just type ren foldername newname.
![Page 55: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/55.jpg)
ren 7tutorials_v1 7tutorials_final
![Page 56: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/56.jpg)
![Page 57: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/57.jpg)
COPY FILES AND FOLDERS
![Page 58: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/58.jpg)
The Copy command allows you to copy files from one location to another. To use this command you have to type
copy location\filename.extension location\newname.extension.
![Page 59: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/59.jpg)
![Page 60: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/60.jpg)
To copy a folder and its content from a location to another we will use the XCOPY command followed by the /s / i operators.
![Page 61: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/61.jpg)
DELETE FILES AND WORDS
![Page 62: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/62.jpg)
The DEL (Delete) is used to delete files within the directories you've created.
To delete all the files from a directory you have to type del directory name.
![Page 63: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/63.jpg)
If we need to delete a single file we will use the DEL command followed by the filename.
![Page 64: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/64.jpg)
![Page 65: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/65.jpg)
The DEL command cannot be used to delete directories, therefore we will use another command to remove any empty directory: RD (Remove Directory).
![Page 66: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/66.jpg)
LAUNCH AN APPLICATION
FROM COMAMND
![Page 67: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/67.jpg)
To run a program from the Command Prompt, you need only to navigate to the directory that contains the executable and simply type in the program name.
![Page 68: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/68.jpg)
For example, if we want to launch Paint using Command Line, we have to go to C:\Windows\System32 and there we will find the executable called mspaint.exe. Let's see how this operation can be done, if we are on D:\7tutorials. First off all we have to change the working directory to the application's folder by typing cd/d c:\windows\System32\. Then we just write mspaint.exe and press Enter. Both commands can be seen in the capture below.
![Page 69: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/69.jpg)
![Page 70: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/70.jpg)
HOW TO USE HELP IN
COMMAND PROMPT
![Page 71: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/71.jpg)
To access help in Command Prompt you just have to type the help command and then press Enter. A list off all available commands will be displayed.
![Page 72: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/72.jpg)
![Page 73: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/73.jpg)
REPAIR MISSING OR CORRUPT
FILES
![Page 74: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/74.jpg)
NOTE: When a corrupt or missing system file prevents the operating system from booting normally, you need to use the Windows 7 setup DVD or a System Repair Disc to start the Command Prompt and, from there the System File Checker (SFC). If Windows 7 boots, but you get messages about missing system files, you will be able to fix the problem by running the System File Checker (SFC) in the Command Prompt
![Page 75: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/75.jpg)
FIX MISSING OR CORRUPT FILES
WHEN THE COMPUTER WON’T
BOOT
![Page 76: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/76.jpg)
In the Command Prompt window, use the sfc command with two additional parameters:/offbootdir and /offwindir.
The parameter /offbootdir is used to specify the boot partition - the partition that contains the boot files needed for booting Windows 7. The /offwindir parameter is designed to specify the location of the Windows 7 directory.
![Page 77: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/77.jpg)
![Page 78: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/78.jpg)
FIX MISSING OR CORRUPTED FILES
![Page 79: Programming](https://reader036.vdocument.in/reader036/viewer/2022070303/54b5ec4d4a795918458b456b/html5/thumbnails/79.jpg)