lunes, 29 de febrero de 2016

More MS-DOS


More MS-DOS




REVIEW


·       Which or the following valid DOS filenames:



        X.Y

        AUTO_EXEC.BAT     

        AUTOEXEC

        AUTOEXEC.BAS       

        MYMASTER.TEST    

              MY*MAST.





·       Use the file tree structure shown below

o   Your current DOS prompt is    C:\ROOT\GREEN\BLACK>



o   Using relative addressing, write a single DOS statement to move to directory  BLUE  

CD BLUE



o   Using direct addressing (fully concatenated path), write a single DOS statement to move to directory GREEN

CD C:\ROOT\GREEN



o   Using relative addressing, write a single DOS statement to move to directory PURPLE

CD ..\RED\PURPLE



o   Using relative addressing, write a single DOS statement to remove  to directory YELLOW

RD ..\..\YELLOW









MARY.DOC










JOHN.TXT




0RED

0PURPLE










SUSAN.XLS



0ROOT









0YELLOW





MICHELLE.TXT




TOM.DAT




C:\





0BLUE

FRED.BAS


0GREEN

0BLACK










ANDY.PPT



ANDY.SYS











Using Wildcards




DIR               Extended DOS Command


Used To:         View the directory structure from the current point down one level

                        Identifies all directories (folders) that exist ONE level down from the current directory

                        Identifies all files that reside within the current directory level



Syntax:           DIR   namepattern[.extentpattern] /P /W      



Where:     namepattern  is a matching mask for filenames or directory names

                        extentpattern is a matching mask for file extensions

               Default display shows a separate line for each file and directory that meets the matching mask.  Modify date and file size is shown for all files.  Last modified date and the phrase <DIR> are shown for all directories.

                        /P is an optional parameter that displays one screen and then pauses.  Pressing any key causes the next page to be displayed.

          /W is an optional parameter that displays the files and folders across the line (Wide) without any details.  Directories are enclosed within [  ].



Special:          Matching masks may include letters and numbers

                        Matching masks may include wildcard characters in any position

                                    ?   one occurrence of any single character

*   any number (including 0) of occurrences of any characters   

                           



DIR *.txt              Displays the names of any files with an extension of txt

DIR CGS???.*   Displays the names of any files that start CGS and then exactly three characters.  These files may have any extension.

               Also displays any directories that start with CGS and then exactly three characters.

DIR *.*        Displays the names of all files and all directories.  (Same as DIR)

DIR *CGS*.*    Displays the names of all files and all directories which have any number of characters (including none) then the characters CGS, then any number of characters (including none) followed by any extension (including none)





Would the statement DIR *CGS*.* display the following files / directories?



            <DIR>     XXXCGS123              yes

                                    CGS.TXT                   yes

            <DIR>     CCCGGGSSS              no – the string CGS does not appear 

                                    CGSCGS.BAT            yes

            <DIR>     CCCCGSSSS              yes

                                    CCCCGSSSS.TXT     no – invalid file name

                                   

 Would the statement DIR C?S* display the following files / directories?



            <DIR>     XXXCGS123              no – does not start with C

                                    CGS.TXT                   yes

            <DIR>     CCCGGGSSS              no – third digit is not S         

                                    CGSCGS.BAT            yes

            <DIR>     CCCCGSSSS              no – third digit is not S

                                    CCSSSS.TXT                        yes





Anyone need more examples?





Copying Files


 

COPY          New DOS Command



Used To:         Make a duplicate of a file and save it under a revised name and/or at a different location in the directory system.



Syntax:           COPY   sourcefile   destinationfile      



Where:     sourcefile  is a relative address or direct address (full path) of the file to be copied.

                        destinationfile  is a relative address or direct address (full path) of the file to be created.  Note: file name may be omitted.



Special:          sourcefile  must reference a valid file name or CON:

                        sourcefile  may contain wildcards in which case, multiple files may be copied.  If this is the case, no filename should be specified in the destinationfile

                        destinationfile may NOT contain wildcards     

                        If destinationfile omits a file name, the file will be created in the destination path using the same file name as the sourcefile 

                        If destinationfile is specified as CON:, the sourcefile  is displayed on the console screen.

                        If destinationfile is specified as PRN:, the sourcefile  is displayed on the local printer (COM1).

                        If sourcefile  is specified as CON:, the subsequent data typed into the screen will be copied to destinationfile.  Use CTRL+Z to terminate input.

A:\ROOT\LAB1>


copy FILE1.TXT A:\ROOT\LAB2\FILECOPY.TXT

copy FILE1.TXT A:\ROOT\LAB2        ß new filename is FILE1.TXT

copy FILE1.TXT ..\LAB2\FILE3.TXT

copy ..\FILECOPY.TXT CON:

copy ..\FILECOPY.TXT PRN:





Deleting Files



DEL / DELETE         New DOS Command



Used To:         Delete a file from the disk FAT (file allocation table)



Syntax:           DEL filename      



Where:     filename  is a relative address or direct address (full path) of the file to be deleted.        



Special:          filename may contain wildcards in which case multiple files will be deleted (CAREFUL!)

                        The file remains on the media however the file allocation table removes its reference.  The space is made available to be overwritten.

                        The command erase may also be used to delete a file.

                        If the file does not exist, an error message is displayed.

 


DEL   A:\CGS1561\LAB1\DETAIL.TXT

ERASE ..\LAB2\SPEC.TXT

ERASE ..\LAB3\*.*





Renaming Files



REN / RENAME           New DOS Command



Used To:         Change the name of a file.



Syntax:           COPY   sourcefile   destinationfile      



Where:     sourcefile  is a relative address or direct address (full path) of the file to be renamed and or moved.

                        destinationfilename  is the new file name.



Special:    Both sourcefile and destinationfilename may contain the * wildcard. (CAREFUL)  The * must appear in the same relative position.

                        NOTE: You cannot change the path of the file using the REN command.     



REN   A:\CGS1561\LAB1\DETAIL.TXT DETAIL2.BAS

These will give some interesting results!  Characters are carried or lost.
 
REN  FILE1 FILE2

REN  CGSP1561*.*  CGS1561*.*

REN  XYZ*.*  ABCDE*.*     



Moving Files


·       DOS does not support the relocation of files

·       Use a 2-Step method

o   Copy the file from its original location to the new location

o   Delete the file from its original location

o   If desired, rename it once it is in the new location


TREE           Extended DOS Command



Used To:         Display the directory structure and files



Syntax:           TREE /F



Special:    This command will display a graphic representation of the directory structure starting with the current level.

                        /F causes file names to be displayed as well as the directories.



PROMPT   New DOS Command



Used To:         Change the system prompt that appears after each DOS command is completed.



Syntax:           PROMPT $p1[$p2][$p3][$pn]



Where:            p1,p2,p3…pn identify which special information should be shown in the prompt message.

                        p1,p2,p3…pn idRefer to page 13 in the DOS handout for a complete set of allowable options.



Special:    At start time, AUTOEXEC.BAT assigns the prompt to $p$g which displays the current path and the greater than sign  >

                        You can reset the prompt for the current session and it will revert back the next time you restart your computer.

                        If you want a permanent change, this must be done in the AUTOEXEC.BAT file. (CAREFUL!)

                        Any characters (including spaces) typed without the $ will appear in the prompt line.



Prompt $d $t $p     à   Sun 04/20/2003 14:25:22 A:\CGS1561



Prompt $p$g         à   A:\CGS1561





Creating Files Within DOS




EDIT             New DOS Subsystem


Used To:         Create and modify files.



Syntax:           EDIT [filename]



Where:            filename optionally identifies the name of the file to be created (file does not already exist) or modified (file already exists)

                        filename may be an absolute or a relative reference

                        If filename is omitted, DOS creates a new file named Untitled1.  



Special:    The DOS editor will be familiar to users of MSWindows.

                        It has a similar look and feel to Notepad.

                        Hold Alt and press Enter to expand to full screen mode.  In this mode your mouse will work.  In window mode, the mouse will not work.







Using the DOS Editor


·       EDIT – starts the editor and creates a new file named Untitled1

·       Visit the menu items and see how familiar they are

·       File / Print will not work in the FMU lab since we do not have a direct connect printer

·       Some special keys:



­
Move up one line while remaining at the current character position
If the cursor is already at the first line, this has no effect
Shift + ­
Select the current row as well as the one above it
Ctrl + ­
Shift the screen data up one line without affecting the current cursor position.
¯
Move down one line while remaining at the current character position
Shift + ¯
Select the current row as well as the one below it
Ctrl + ¯
Shift the screen data down one line without affecting the current cursor position.
®
Move one character to the right while remaining on the current line




Shift + ®
Select the current character and move to the right (repeat to select multiple characters)
Ctrl + ®
Skip to the right until you encounter the next word (the next character that follows one or more spaces) Will wrap from one line to the next
¬
Move one character to the left while remaining on the current line
If the cursor is already at the first character, this has no effect
Shift + ¬
Select the current character and move to the left (repeat to select multiple characters)
Ctrl + ¬
Skip to the left until you encounter the next word (the next character that follows one or more spaces) and position on the first character of that word.
Will wrap from one line to the next
Home
Move to the first character on the current line
Ctrl + Home
Move to the first character in the program
End
Move to the last character on the current line
Ctrl + End
Move to the first character of the last line in the program
Insert
A toggle key that switches between "overtype" and "insert" modes
The interface does not identify its current mode.
Most people prefer "insert" mode
Page Up
Move one screen toward the top of the program (based on the current position)
Page Down
Move one screen toward the bottom of the program (based on the current position)
Enter
Start a new line (instruction).
If the cursor was in the middle of the line, the line is broken at that point and the right part flows to a new line
Tab
Skip to the next predefine tab position (use Alt + O to reset)
Delete
Remove the single character to the right of the cursor.
If one or more characters has been selected, the highlighted characters are removed
Ctrl + Y
Delete the current line
Ctrl + C
Copy the selected area into the buffer
Ctrl + V
Copy the buffer into the selected area
Ctrl + X
Delete the selected area








TYPE            New DOS Command



Used To:         Display the contents of a file to the screen.



Syntax:           TYPE filename



Where:            filename optionally identifies the name of the file to be displayed

                        filename may be an absolute or a relative reference

                             



Special:    TYPE will attempt to display the contents of any file regardless of its type or extension.

                        If the file is not textual data, the appearance may be peculiar.

                       





TYPE A:\MyFiles\File1.txt















END OF DOS 2

1 comentario:

  1. POR FAVOR LEA !! Hola chicos !!! Soy Caro, vivo en Ohio, EE. UU. Tengo 32 años, estoy muy feliz de haber recibido mi tarjeta de cajero automático en blanco de Adriano. Mi tarjeta de cajero automático en blanco puede retirar $ 4,000 por día. Lo obtuve de Él la semana pasada y ahora he retirado alrededor de $ 10,000 gratis. El cajero automático en blanco retira dinero de cualquier cajero automático y no tiene nombre porque está en blanco, solo su PIN estará en él, no se puede rastrear y ahora tengo dinero para negocios, compras y suficiente dinero para mí y mi familia. vivo. Estoy muy contento y feliz de haber conocido a Adriano porque conocí a cinco personas antes que él y no pudieron ayudarme. Pero estoy feliz ahora que Adriano envió la tarjeta a través de DHL y la recibí en dos días. Obtenga su propia tarjeta de él en este momento, la está dando por una pequeña tarifa para ayudar a las personas, incluso si es ilegal, pero ayuda mucho y nadie es atrapado o rastreado. Estoy feliz y agradecido con Adriano porque cambió mi historia de repente. La tarjeta funciona en todos los países. Es una buena noticia. La dirección de correo electrónico de Adriano es adrianohackers01@gmail.com

    ResponderEliminar