Specification Shortcuts Wildcards of DOS command all shortcuts of Microsoft disk operating system and meaning syntax and importance of * and ?

Data Recovery PRO DATA DOCTOR

Home | Order Online | Downloads | Contact Us | Software Knowledgebase

it | es | pt | fr | de | jp | kr | cn | ru | nl | gr


Specification Shortcuts, Wildcards and Redirection

Shortcuts

A number of DOS commands recognize certain shortcuts when navigating between directories. The best known of these are:

 Shortcut

 Why to use it

.

to refer to the current directory

..

to refer to the parent directory

\

to refer to the root directory of the current drive.

drive:

to refer to the current directory on drive

Let us try to understand it with the help of examples. If the current directory on the c: drive is c:\windows\java\notes, then dir c: at the a:\> prompt will list the files in c:\windows\java\notes

  1. If the current drive and directory is c:\data\docs\letters, then:

Command

.

..

...

\

CD
or
CHDIR

Nothing.
Current directory stays as: c:\windows\ java\notes

Change to parent directory: c:\windows\java

Change to parent's parent directory:
c:\windows

Change to root directory: c:\

DIR

Displays contents of current directory:
c:\windows\ java\notes

Displays contents of parent directory: c:\windows\java

Displays contents of parent's parent directory: c:\windows

Displays contents of root directory: c:\

 

  1. If the current drive and directory is c:\, then:

Command

.

..

...

\

CD
(ChDir)

Nothing - current directory stays as: c:\

Error message:
"Invalid Directory"

Error message:
"Invalid Directory"

Nothing.
Current directory stays as: c:\

DIR

Displays contents of current directory: c:\

Error message: "Invalid Directory"

Displays directories and extension less files of current directory

Displays contents of root directory: c:\

 

Wildcards

Many DOS commands like, ATTRIB, COPY, DEL, DELTREE, etc., accept the use of the "wildcards" (* and ?). Generally terms, * refers to multiple characters and ? refers to a single character in a file or directory name.

This is the reason we can not use these characters in the name of any file. These Special characters are / \ : * ? < > “ | which should not be tried to insert in a file name. Following table shows the use of wildcards:

Wildcard

What it does

*.*

All files with all extensions.

*data*.*

All files with "data" anywhere in its name.

*array.*

All files with names ending with "array"

note?.cpp

All files named "note" plus one character and with .CPP extensions. This file may be note1.cpp, but not note.cpp.

?t*.*

All files with an "t" as second letter in their names


It should be noted that not all commands handle wildcards in exactly the same way. For example DIR * and DIR *.* are considered synonymous but DEL * would delete only files without an extension.

A space enclosed by inverted commas (" ") is accepted as a valid file specification by EDIT and DEL yet in rather different ways.

EDIT will open a file using the name of the current directory. Thus if the current directory is D:\windows\java\notes, EDIT " " will create a file in that directory called "notes".

DEL recognizes " " as *.* and will prompt for confirmation before deleting all files in the directory. As with EDIT, the number of spaces between the inverted commas does not seem significant but if there are no spaces an error message is displayed saying that a required parameter missing.

Unlike EDIT, a path can be included and, if it is, no spaces between inverted commas are required. i.e. to delete all files in the current directory:

DEL ./"" works, but DEL "" gives an error message.

COPY also sees " " as *.* and, like DEL, accepts a path with it. Unlike DEL, there must always be a space between the inverted commas, even when a path is included

Sample Chapters from book DATA RECOVERY WITH AND WITHOUT PROGRAMMING by Author Tarun Tyagi
Data Recovery with & without Programming


Publishers of the Book
Number of Pages
ISBN
Price of the Book


BPB Publications, New Delhi, India
540
81-7656-922-4
$69.00 (Including Shipping Charges, Cost of Book and Other expenses, Free Source Code CD included with the Book)





Buy Data recovery Book

Previous page

page 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15

Next page

© Copyright 2002-2005 DataDoctor.Biz

Home | Contact us | Downloads | Services | Terms and conditions | Site map

Website Data Recovery | recuperación de Datos | Récupération de données | Datenrettung | Recupero dati | データ復旧 | 데이터 복구 | 数据恢复 | Восстановление данных | De terugwinning van gegevens | Ανάκτηση δεδομένων
Sitemap Site map1 2 3 4 | Spanish1 2 3 | French1 2 3 | German1 2 3 | Italian1 2 3 | Portuguese1 2 3 | Japanese1 2 3 | Korean1 2 3 | Chinese1 2 3 | Russian1 2 3 | Dutch1 2 3 | Greek1 2 3
Data Recovery Book English | Spanish | French | German | Italian | Portuguese | Japanese | Korean | Chinese | Russian | Dutch | Greek