Options

command line switches

gregweb16gregweb16 Member Posts: 23 ■□□□□□□□□□
The objectives say that one should know the list of commands (Dir, attrib, etc) plus switches. Does anyone know what sorts of switches the objectives might be referring to/what might come up on the exam?

Comments

  • Options
    sprkymrksprkymrk Member Posts: 4,884 ■■■□□□□□□□
    I never took the A+, but you can find the various switches for most commands by running them from a command propmt with the /? switch. Here is an example:

    C:\>attrib /?
    Displays or changes file attributes.

    ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename]
    [/S [/D]]

    + Sets an attribute.
    - Clears an attribute.
    R Read-only file attribute.
    A Archive file attribute.
    S System file attribute.
    H Hidden file attribute.
    [drive:][path][filename]
    Specifies a file or files for attrib to process.
    /S Processes matching files in the current folder
    and all subfolders.
    /D Processes folders as well.


    So according to the output, you can use the attrib command with a +R to make a file "read only". Using a -R would clear the "read only" attribute. So here are the uses in that case:

    attrib +R c:\myfile.txt will make the file "read only".
    attrib -R c:\myfile.txt will clear the read only attribute.
    attrib c:\myfile.txt will display, or tell you, the attributes of the file.

    I recommend exploring the various commands and their switches by using the /? for anything that may be on the exam.
    All things are possible, only believe.
Sign In or Register to comment.