1 / 28

Chapter 2

Chapter 2. Command Syntax. Command Syntax. Word order Punctuation. command name [variable parameters] [fixed parameters]. Examples: DIR A: /W DISKCOPY A: A: XCOPY A:* C:WUGXP /S/E/V. Parameters. What are parameters Information that modifies a command Variable parameters

keagan
Download Presentation

Chapter 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 2 Command Syntax G. DeRoest

  2. Command Syntax • Word order • Punctuation command name [variable parameters] [fixed parameters] Examples: DIR A:\ /W DISKCOPY A: A: XCOPY A:\* C:\WUGXP /S/E/V G. DeRoest

  3. Parameters • What are parameters • Information that modifies a command • Variable parameters • Information that is user defined • Fixed Parameters • Information that the operating system pre-defines • Defaults • Parameters that commands will use if no others are specified G. DeRoest

  4. Command Syntax • MS-DOS commands are flexible – they can be used to perform several tasks. • A command can be augmented by using parameters • There are two types of parameters • Variable • Fixed A:\> DIR A:\> DIR letter.doc A:\> DIR /W A:\> DIR letter.doc /W G. DeRoest

  5. Reading a Syntax Diagram DATE [/T | date] A:\> DATE A:\> DATE /T A:\> DATE 05/14/2003 G. DeRoest

  6. Reading a Syntax Diagram CD [drive:][path] A:\> CD A:\> CD letters A:\> CD A:\letters A:\> CD .. G. DeRoest

  7. Reading a Syntax Diagram If drive and directory are not defined, then the defaults are used. REN [drive:][path]filename1 filename2 A:\> REN mytext.doc yourtext.doc A:\> REN A:\file1.txt file2.txt A:\> REN C:\letters\memo.pdf “my memo.pdf” G. DeRoest

  8. Reading a Syntax Diagram DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N][/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4] G. DeRoest

  9. Fixed Parameters with DIR Command • DIR /P • DIR /W • DIR /P /W • DIR /OD • DIR /O-N • DIR /S • DIR /? • See page 848 for printed version G. DeRoest

  10. Variable Parameters • Variable parameters are usually used to identify a drive, directory, and/or file name or names A:\> DIR jan.99 A:\> DIR steven.fil A:\> DIR c:\winnt\system32\*.exe G. DeRoest

  11. DOS File Names • All files within a directory must have a unique name • Names are required and may be less than 255 characters • File extensions art usually 3 characters long • Names cannot contain :“/\|<>*? G. DeRoest

  12. File Names with Spaces • DIR “Sandy and Patty.txt” G. DeRoest

  13. 8.3 File Names DIR SANDYA~1.TXT G. DeRoest

  14. Command Line Editing G. DeRoest

  15. Command Line Editing G. DeRoest

  16. Drives and Device Names • A: • B: • C: • D: • E: • F: • G: • ... G. DeRoest

  17. Changing Defaults • Default drive: • A: C: G: • Default directory: • cd \ • cd \windosbk • cd “\program files” G. DeRoest

  18. Variable Parameters with DIR Display the list of files in the default directory of drive A: • C: • CD \ • DIR A: • DIR HELLO.TXT • DIR A:HELLO.TXT Look in the default directory of the default drive Display file in the default directory of drive A: G. DeRoest

  19. Changing Directory • C: • CD • CD \ • CD \WINNT\SYSTEM32 • DIR /W G. DeRoest

  20. Directory Structure \ B winnt files apps A C D local money game E G F G. DeRoest

  21. Changing Directory • A: • CD \MEDIA • CD \MOVIES • CD \MEDIA\MOVIES • CD MOVIES G. DeRoest

  22. Wildcards • Used to define a group of filenames • One or more characters * • One or zero character ? G. DeRoest

  23. DIR and Wildcards • C: • CD \WINNT\SYSTEM32 • DIR P • DIR P*.* • DIR P* • DIR P*.EXE • DIR *.SYS G. DeRoest

  24. DIR and Wildcards • DIR A:\?????.TXT • DIR A:\?????.* • DIR A:\?????. G. DeRoest

  25. Redirection Tools to define where the output of a command will display. COMMAND>DESTINATION G. DeRoest

  26. Redirection Examples • A: • DIR *.NEW • DIR *.NEW > MY.HW • DIR MY.HW G. DeRoest

  27. Redirection Examples • ECHO GARY • ECHO GARY > PRN • ECHO GARY > LPT1 • ECHO GARY > LPT2 G. DeRoest

  28. DIR /? C:\>dir /? Displays a list of files and subdirectories in a directory. DIR [drive:][path][filename] [/A[[:]attributes]] [/B] [/C] [/D] [/L] [/N] [/O[[:]sortorder]] [/P] [/Q] [/S] [/T[[:]timefield]] [/W] [/X] [/4] [drive:][path][filename] Specifies drive, directory, and/or files to list. /A Displays files with specified attributes. attributes D Directories R Read-only files H Hidden files A Files ready for archiving S System files - Prefix meaning not /B Uses bare format (no heading information or summary). /C Display the thousand separator in file sizes. This is the default. Use /-C to disable display of separator. /D Same as wide but files are list sorted by column. /L Uses lowercase. /N New long list format where filenames are on the far right. /O List by files in sorted order. sortorder N By name (alphabetic) S By size (smallest first) E By extension (alphabetic) D By date/time (oldest first) G Group directories first - Prefix to reverse order /P Pauses after each screenful of information. /Q Display the owner of the file. /S Displays files in specified directory and all subdirectories. /T Controls which time field displayed or used for sorting timefield C Creation A Last Access W Last Written /W Uses wide list format. /X This displays the short names generated for non-8dot3 file names. The format is that of /N with the short name inserted before the long name. If no short name is present, blanks are displayed in its place. /4 Displays four-digit years Switches may be preset in the DIRCMD environment variable. Override preset switches by prefixing any switch with - (hyphen)--for example, /-W. G. DeRoest

More Related