Windows XP Desktop. Open DOS Command Window.

29
Windows XP Desktop Windows XP Desktop

Transcript of Windows XP Desktop. Open DOS Command Window.

Page 1: Windows XP Desktop. Open DOS Command Window.

Windows XP DesktopWindows XP Desktop

Page 2: Windows XP Desktop. Open DOS Command Window.

Open DOS Command Open DOS Command WindowWindow

Page 3: Windows XP Desktop. Open DOS Command Window.

Open DOS Command Open DOS Command WindowWindow

Page 4: Windows XP Desktop. Open DOS Command Window.

Open DOS Command Open DOS Command WindowWindow

Page 5: Windows XP Desktop. Open DOS Command Window.

Open DOS Command Open DOS Command WindowWindow

Page 6: Windows XP Desktop. Open DOS Command Window.

Open DOS Command Open DOS Command WindowWindow

Page 7: Windows XP Desktop. Open DOS Command Window.

An Alternative WayAn Alternative Way

Page 8: Windows XP Desktop. Open DOS Command Window.

An Alternative WayAn Alternative Way

Page 9: Windows XP Desktop. Open DOS Command Window.

An Alternative WayAn Alternative Way

Page 10: Windows XP Desktop. Open DOS Command Window.

An Alternative WayAn Alternative Way

Page 11: Windows XP Desktop. Open DOS Command Window.

An Alternative WayAn Alternative Way

Page 12: Windows XP Desktop. Open DOS Command Window.

DOS (console) WindowDOS (console) Window

Page 13: Windows XP Desktop. Open DOS Command Window.

Change DrivesChange DrivesTo change to another disk drive, key in the drive letter ( ‘A’, ‘C’, ‘D’, etc) followed by a colon (‘:’) then press the <Enter> key.

Page 14: Windows XP Desktop. Open DOS Command Window.

Change DrivesChange DrivesThe DOS Prompt should now look like the following. Drive A: is now the current default drive.

Page 15: Windows XP Desktop. Open DOS Command Window.

The DIR CommandThe DIR Command

We have a directory full of disk filesWe have a directory full of disk files How do we look at what is on the How do we look at what is on the

disk or what files are in a directory?disk or what files are in a directory? What is a directory anyway?What is a directory anyway? Use the Use the DIRDIR command command

Page 16: Windows XP Desktop. Open DOS Command Window.

Entering the DIR Entering the DIR Command Command

Page 17: Windows XP Desktop. Open DOS Command Window.

/? To Get Help on the DIR /? To Get Help on the DIR CommandCommand

Page 18: Windows XP Desktop. Open DOS Command Window.

DIR CommandDIR Command At the topAt the top

Volume labelVolume label serial numberserial number drive (and directories)drive (and directories)

Page 19: Windows XP Desktop. Open DOS Command Window.

The DIR Command The DIR Command ShowsShows For each fileFor each file

file namefile name file extensionfile extension file sizefile size (in bytes) (in bytes) file datefile date (created or last (created or last

modified)modified) file timefile time (created or last (created or last

modified)modified)

at the bottomat the bottom # of files# of files bytes usedbytes used # of directories# of directories bytes availablebytes available

Page 20: Windows XP Desktop. Open DOS Command Window.

DIR Command OptionsDIR Command Options /P/P pause after displaying a page pause after displaying a page /W/W display ‘wide’ (five files per column) display ‘wide’ (five files per column) /X/X includes short filenames includes short filenames Change Sort OrderChange Sort Order

/O /O - alpha by main file name then extension- alpha by main file name then extension /ON/ON - alpha by main file name - alpha by main file name /OE/OE - alpha by extension - alpha by extension /OEN/OEN - alpha by extension, then main name - alpha by extension, then main name /OD/OD - by date and time - by date and time /OS/OS - by size - by size Alternate format Alternate format /O:S/O:S

Page 21: Windows XP Desktop. Open DOS Command Window.

EXAMPLESEXAMPLES Insert your Insert your DATADISKDATADISK in drive in drive AA List all files alphabetically by file nameList all files alphabetically by file name Find the smallest fileFind the smallest file Find the oldest fileFind the oldest file How many files have an How many files have an “.LST“.LST” extension” extension How many files are there on the diskHow many files are there on the disk How many files have How many files have 1~2991~299 bytes (size) bytes (size) How many files do not have an extensionHow many files do not have an extension

Page 22: Windows XP Desktop. Open DOS Command Window.

A note on the order A note on the order switchswitch

You can reverse the order of the optional You can reverse the order of the optional parameter of the ‘parameter of the ‘sort ordersort order’ switch (pg ’ switch (pg 48).48).

If you put a dash ‘If you put a dash ‘--’ in front of the ’ in front of the optional parameter, the order is reversed.optional parameter, the order is reversed.

Examples:Examples: A:\>DIR /OE A:\>DIR /O-EA:\>DIR /OE A:\>DIR /O-E A:\>DIR /OS A:\>DIR /O-SA:\>DIR /OS A:\>DIR /O-S

Page 23: Windows XP Desktop. Open DOS Command Window.

wildcardswildcards and the DIR and the DIR

When you enter When you enter DIRDIR you get all you get all files in that directory listed for you.files in that directory listed for you.

There are 2 wildcards that allow you There are 2 wildcards that allow you to select the files to be listedto select the files to be listed

?? Replaces a single character Replaces a single character

** replaces a number of charactersreplaces a number of characters

Page 24: Windows XP Desktop. Open DOS Command Window.

The The ** wildcard wildcard DIRDIR lists all files in that directory lists all files in that directory DIR PA*DIR PA* lists all files starting with ‘ lists all files starting with ‘PAPA’’ DIR *TDIR *T lists all files ending with an ‘ lists all files ending with an ‘TT’’ DIR A*LSDIR A*LS lists all files starting with an ‘ lists all files starting with an ‘AA’’

and ending with an ‘ and ending with an ‘LSLS’’ DIR *.PPTDIR *.PPT lists all files with a lists all files with a .PPT.PPT

extension extension DIR *T.*DIR *T.* lists all files where the last lists all files where the last

letterletter of the file name (not the ext) is of the file name (not the ext) is ““TT””

Page 25: Windows XP Desktop. Open DOS Command Window.

Using your DATADISKUsing your DATADISK How many files start with a “How many files start with a “PP”?”? How many files have an extension of How many files have an extension of

““XLSXLS”?”? How many files have an extension that How many files have an extension that

starts with “starts with “WW”?”? How many file names start with “How many file names start with “INVINV”?”? How many files have an “How many files have an “SUSU” somewhere ” somewhere

in their file name (not extension)?in their file name (not extension)?

Page 26: Windows XP Desktop. Open DOS Command Window.

The ? wildcardThe ? wildcard The The ?? replaces a single character replaces a single character

DIR PALETTE???.BMPDIR PALETTE???.BMP lists all lists all files that start with ‘PALETTE’, files that start with ‘PALETTE’, then any 3 characters, then ‘BMP’then any 3 characters, then ‘BMP’

DIR “PALETTE ??.BMP” DIR “PALETTE ??.BMP” lists lists all files starting with all files starting with ‘Palette[space]’, then any 2 ‘Palette[space]’, then any 2 characters, then ‘BMP’.characters, then ‘BMP’.

What happens if you try it without What happens if you try it without the quotes?the quotes?

Page 27: Windows XP Desktop. Open DOS Command Window.

Using your DATADISKUsing your DATADISK

How many files have an “How many files have an “NN” as the ” as the second letter of their file name?second letter of their file name?

How many files have a 3 character How many files have a 3 character extension that starts with “extension that starts with “PPPP”?”?

How many files have a “How many files have a “FTFT” in the ” in the 33rdrd and 4 and 4thth letters? letters?

Page 28: Windows XP Desktop. Open DOS Command Window.

Default SwitchesDefault Switches DOS saves important settings in a DOS saves important settings in a

memory area called the memory area called the DOS DOS ENVIRONMENTENVIRONMENT

to see the environment, key in: to see the environment, key in: A:\>SETA:\>SET the env. variable for the env. variable for DIRDIR is is DIRCMDDIRCMD to change the settings, key in: to change the settings, key in:

A:\SET ‘environment variable”=stringA:\SET ‘environment variable”=string to set DIR commands enter (example) to set DIR commands enter (example)

A:\SET DIRCMD=/P/OA:\SET DIRCMD=/P/O now again, key in now again, key in A:\>SETA:\>SET

Page 29: Windows XP Desktop. Open DOS Command Window.

AttributesAttributes

• DIR /AHDIR /AH Hidden filesHidden files• DIR /ARDIR /AR Read onlyRead only• DIR /ASDIR /AS System filesSystem files• DIR /AADIR /AA Archive files - not Archive files - not

backed upbacked up