DISK OPERATING SYSTEM

MODULE 6: SOME OPERATING SYSTEMS UNIT 1: WINDOWS AND DISK OPERATING SYSTEM

Windows and Disk Operating System

  • Windows is an operating system designed by Microsoft.

  • Windows comes preloaded on most new personal computers.

  • Microsoft released the first version of Windows in the mid-1980s.

  • Versions of Windows include Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP.

Disk Operating System (DOS)

  • DOS is a "Disk Operating System" designed for operating the computer from a disk.

  • DOS enables the user to organize data files, load and execute program files, and control input and output devices.

  • DOS is a single-user, single-task operating system with a basic command line and no GUI.

  • DOS is strictly command line functional, with no icons, mouse, or graphics.

Booting

  • Booting is the initial process of loading and executing the operating system on the computer.

Communicating with DOS

  • The original DOS was entirely text-based, with a command prompt where users would type commands.

  • All modern operating systems, including Windows, continue to use some form of the command prompt.

Organizing Disks in DOS

  • DOS works within a file, directory, and disk drive structure.

  • Program and data files are named and grouped together in named directories on disks.

  • Directories are lists of files.

File Naming in DOS

  • The standard DOS filename format is 1-8 letter name, period, 3 letter extension.

  • Extensions allow files of a similar type to be grouped together.

  • Extensions have become standardized for different file formats.

Directory Naming in DOS

  • Every disk drive has a root directory that can have subdirectories.

  • Subdirectories are named in the same format as filenames.

  • A directory path name includes the disk drive and all subdirectories needed to specify a directory on a disk.

Using DOS

  • Typing commands at the DOS prompt tells DOS to run a program.

  • DOS looks for internal command programs or external files with the .COM or .EXE extension to load and run.

  • DOS can be accessed through the Start Menu or by typing "cmd" in the search bar.

Accessing a List of DOS Commands

  • To access the DOS help facility, type "Help" in the Command Prompt and press Enter.

  • DOS provides an alphabetized list of commands with descriptions.

  • To view the use of a command, type the command followed by /? in the command prompt.

FILE

  • A file is a group of organized data stored in permanent storage like hard disks or flash drives.

  • There are two types of files: document files and program files.

  • Document files hold documents like letters and applications and require an application program to run.

  • Program files are executable files that can run on their own.

Directory

  • A directory is a list of files stored in the computer's memory for reference.

  • A directory can contain subdirectories.

  • The root directory is automatically created when the disk is formatted.

  • The current directory is the directory you are currently working with.

  • The parent directory is one level up from the current directory.

DOS Commands

  • Commands are instructions given to the computer to perform specified work.

  • There are two types of commands: internal and external commands.

  • Internal commands are part of command.com and do not need to read a file to run.

  • External commands are available on the disk and can be invoked whenever necessary.

Page 6:

  • Parameters for setting the date:

    • <month-day-year>: Sets the date specified

    • Separated by periods (.), hyphens (-), or slash marks (/)

    • Values for month: 1 through 12

    • Values for day: 1 through 31

    • Values for year: 00 through 99 or 1980 through 2099

  • Parameters for displaying the current date:

    • /t: Displays the current date without prompting for a new date

    • /?: Displays help at the command prompt

  • Parameters for setting the system time:

    • <HH>[:<MM>[:<SS>[.<NN>]]] [am|pm]: Sets the system time to the new time specified

    • HH: hours (required)

    • MM: minutes

    • SS: seconds

    • NN: hundredths of a second

    • If am or pm is not specified, time uses the 24-hour format by default

  • Parameters for displaying the current time:

    • /t: Displays the current time without prompting for a new time

    • /?: Displays help at the command prompt

  • Parameters for displaying the operating system version number:

    • /?: Displays help at the command prompt

  • Parameters for displaying the disk volume label and serial number:

    • <Drive>: Specifies the drive that contains the disk

    • /?: Displays help at the command prompt

Page 7:

  • Parameters for clearing the Command Prompt window:

    • /?: Displays help at the command prompt

  • Parameters for creating a file using the COPY CON command:

    • copy con [drive][path]<file name>

    • Press ^Z (CTRL+Z) or F6 to save the file

    • File name rules:

      • Must be unique

      • Divided into two parts: primary name (8 characters) and secondary name (3 characters)

      • Only one dot (.) can be used to separate primary and secondary name

  • Parameters for displaying the contents of a text file using the TYPE command:

    • [<Drive>:][<Path>]<FileName>: Specifies the location and name of the file

    • /?: Displays help at the command prompt

  • Parameters for displaying a list of files and subdirectories using the DIR command:

    • [<drive>:][<path>][<filename>]: Specifies the drive, directory, and file(s) to list

    • /p: Displays one screen of the listing at a time

    • /q: Displays file ownership information

    • /w: Displays the listing in wide format

    • /d: Displays the listing in the same format as /w, but sorted by column

    • /a[[:]<attributes>]: Displays only directories and files with specified attributes

    • /o[[:]<sortorder>]: Sorts the output according to sortorder

    • /t[[:]<timefield>]: Specifies which time field to display or use for sorting

    • /s: Lists every occurrence of the specified file name within the directory and subdirectories

    • /b: Displays a bare list of directories and files

    • /l: Displays unsorted directory and file names using lowercase

    • /?: Displays help at the command prompt

Page 8:

  • /a[[:]<attributes>] values for the DIR command:

    • d: Directories

    • h: Hidden files

    • s: System files

    • l: Reparse points

    • r: Read-only files

    • a: Files ready for archiving

    • i: Not content indexed files

    • Can use any combination of these values without spaces

  • /o[[:]<sortorder>] values for the DIR command:

    • n: Alphabetically by name

    • e: Alphabetically by extension

    • g: Group directories first

    • s: By size, smallest first

    • d: By date/time, oldest first

    • Use - prefix to reverse the sort order

  • /t[[:]<timefield>] values for the DIR command:

    • c: Creation time

    • a: Last accessed time

    • w: Last written time

  • /b: Displays a bare list of directories and files, overriding /w

  • /l: Displays unsorted directory and file names using lowercase

Page 9

/n

  • Displays a long list format with file names on the far right of the screen.

/x

  • Displays the short names generated for non-8dot3 file names.

  • The display is the same as the display for /n, but the short name is inserted before the long name.

/c

  • Displays the thousand separator in file sizes.

  • This is the default behavior.

  • Use /cto hide separators.

/4

  • Displays years in four-digit format.

/r

  • Display alternate data streams of the file.

/?

  • Displays help at the command prompt.

DEL

  • Deletes one or more files.

  • Syntax: del [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>

Parameters

  • <names>: Specifies a list of one or more files or directories.

  • Wildcards may be used to delete multiple files.

  • If a directory is specified, all files within the directory will be deleted.

  • /p: Prompts for confirmation before deleting the specified file.

  • /f: Forces deletion of read-only files.

  • /s: Deletes specified files from the current directory and all subdirectories.

  • Displays the names of the files as they are being deleted.

  • /q: Specifies quiet mode. You are not prompted for delete confirmation.

  • /a[:]<attributes>: Deletes files based on the following file attributes:

    • r: Read-only files

    • h: Hidden files

    • i: Not content indexed files

    • s: System files

    • a: Files ready for archiving

    • l: Reparse points

    • -: Used as a prefix meaning 'not'

  • /?: Displays help at the command prompt.

COPY

  • Copies one or more files from one location to another.

  • Syntax: copy [/d] [/v] [/n] [/y | /-y] [/z] [/a | /b] <source> [/a | /b] [+<source> [/a | /b] [+ ...]] [<destination> [/a | /b]]

Parameters

  • /d: Allows the encrypted files being copied to be saved as decrypted files at the destination.

  • /v: Verifies that new files are written correctly.

  • /n: Uses a short file name, if available, when copying a file with a name longer than eight characters, or with a file name extension longer than three characters.

  • /y: Suppresses prompting to confirm that you want to overwrite an existing destination file.

  • /-y: Prompts you to confirm that you want to overwrite an existing destination file.

  • /z: Copies networked files in restartable mode.

  • /a: Indicates an ASCII text file.

  • /b: Indicates a binary file.

  • <source>: Specifies the location from which you want to copy a file or set of files.

  • <destination>: Specifies the location to which you want to copy a file or set of files.

  • /?: Displays help at the command prompt.

REN (RENAME)

  • Renames files or directories.

  • Syntax: ren [<drive>:][<path>]<filename1> <filename2>

Parameters

  • [<drive>:][<path>]<filename1>: Specifies the location and name of the file or set of files you want to rename.

  • Filename1 can include wildcard characters (* and ?).

  • <filename2>: Specifies the new name for the file.

  • You can use wildcard characters to specify new names for multiple files.

  • /?: Displays help at the command prompt.

MKDIR (MAKE DIRECTORY)

  • Creates a directory or subdirectory.

  • Command extensions, which are enabled by default, allow you to use a single mkdir command to create intermediate directories in a specified path.

  • Syntax: mkdir [<drive>:]<path>

Parameters

  • <drive>: Specifies the drive on which you want to create the new directory.

  • <path>: Specifies the name and location of the new directory.

  • The maximum length of any single path is determined by the file system.

  • /?: Displays help at the command prompt.

Page 11

CD

  • Displays the name of the current directory or changes the current directory.

  • If used with only a drive letter (for example, cd C:), cd displays the names of the current directory in the specified drive.

  • If used without parameters, cd displays the current drive and directory.

  • Syntax: cd [/d] [<drive>:][<path>] cd [..] chdir [/d] [<drive>:][<path>] chdir [..]

Parameters

  • /d: Changes the current drive as well as the current directory for a drive.

  • <drive>: Specifies the drive to display or change (if different from the current drive).

  • <path>: Specifies the path to the directory that you want to display or change.

  • [..]: Specifies that you want to change to the parent folder.

  • /?: Displays help at the command prompt.

RD

  • Deletes a directory.

  • Syntax: rd [<drive>:]<path> [/s [/q]]

Parameters

  • [<drive>:]<path>: Specifies the location and the name of the directory that you want to delete.

  • Path is required.

  • If you include a backslash () at the beginning of the specified path, then the path starts at the root directory (regardless of the current directory).

  • /s: Deletes a directory tree (the specified directory and all its subdirectories, including all files).

  • /q: Specifies quiet mode. Does not prompt for confirmation when deleting a directory tree.

  • The /q parameter works only if /s is also specified.

  • CAUTION: When you run in quiet mode, the entire directory tree is deleted without confirmation. Make sure that important files are moved or backed up before using the /q command-line option.

  • /?: Displays help at the command prompt.

EXIT

  • Exits the command interpreter or the current batch script.

  • Syntax: exit [/b] [<exitcode>]

Parameters

  • /b: Exits the current batch script instead of exiting Cmd.exe. If executed from outside a batch script, exits Cmd.exe.

  • <exitcode>: Specifies a numeric number. If /b is specified, the ERRORLEVEL environment variable is set to that number. If you are quitting the command interpreter, the process exit code is set to that number.

  • /?: Displays help at the command prompt.

Page 12

  • Syntax: exit [/b] [<exitcode>]

  • Parameters:

    • /b: Exits the current batch script instead of exiting Cmd.exe. If executed from outside a batch script, exits Cmd.exe.

    • <exitcode>: Specifies a numeric number. If /b is specified, the ERRORLEVEL environment variable is set to that number. If you are quitting the command interpreter, the process exit code is set to that number.

    • /?: Displays help at the command prompt.

  • You may visit The Microsoft Windows commands at https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/windows-commands to see the complete