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

Files Recovery Software
Home Contact Details Customer Support Download Demo Products  

 
 

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

Previous page

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

Next page
 
 
Data Recovery Book
 
Chapter 1 An Overview of Data Recovery
Chapter 2 Introduction of Hard Disks
Chapter 3 Logical Approach to Disks and OS
Chapter 4 Number Systems
Chapter 5 Introduction of C Programming
Chapter 6 Introduction to Computer Basics
Chapter 7 Necessary DOS Commands
Chapter 8 Disk-BIOS Functions and Interrupts Handling With C
Chapter 9 Handling Large Hard Disks
Chapter 10 Data Recovery From Corrupted Floppy
Chapter 11 Making Backups
Chapter 12 Reading and Modifying MBR with Programming
Chapter 13 Reading and Modifying DBR with Programming
Chapter 14 Programming for “Raw File” Recovery
Chapter 15 Programming for Data Wipers
Chapter 16 Developing more Utilities for Disks
Appendix Glossary of Data Recovery Terms
 
 
Pro Data Doctor

Home

Products

Contact Details

Customer Support

Download Demo

Terms and Conditions

 
Pro Data Doctor