2.0  Using DOS

2.8 DOS Utility Commands

 


MOVE

 

Type: Internal

 

Syntax:

 

MOVE [/Y|/-Y] [d:][path]filename[,[d:][path]filename[...]] destination

 

Purpose: Moves one or more files to the location you specify. Can also be used to rename directories.

 


Discussion

 

To move a file or files, you specify the name and location of the file or files you want to move followed by the destination. The destination specifies the new location of the file, or the new name of the directory. The destination can consist of a drive letter followed by a colon, a directory name, or a combination. If you are moving only one file, you can also specify a filename. If you are moving more than one file, the destination must be a directory name. If you move a file to an existing file, it will be overwritten.

 

Options

 

/Y - Use this option if you want MOVE to replace existing file(s) without prompting you for a confirmation. Otherwise, the replacement will not be made until you confirm it. If you use MOVE as part of a batch file, existing files will be replaced without a confirmation prompt. This option will override all defaults as well as the current setting of the COPYCMD environment variable.

 

/-Y - Use this option if you want MOVE to provide a confirmation prompt before replacing an existing file. This option will override all defaults as well as the current setting of the COPYCMD environment variable.

 

Examples

 

If you want to move two files named CHAP1 and CHAP2 from the current directory to the \CHAP directory on drive C, enter the following:

 

move chap1, chap2 c:\chap

 

To rename the CHAP directory on drive C to NEWCHAP, enter the following:

 

move c:\chap c:\newchap

 


 

DELTREE

 

Type: External

 

Syntax:

 

DELTREE [/Y] [d:]path [d:]path[...]

 

Purpose: Deletes (erases) a directory including all files and subdirectories that are in it (new with DOS Version 6).

 

Discussion

 

Unlike the RMDIR command, the DELTREE command allows you to delete a directory even if it contains files and subdirectories. All files and subdirectories subordinate to the directory you are deleting will also be deleted regardless of any attributes. This means that even if a file has hidden, system, read-only, or other attributes, it will still be deleted. You can specify more than one directory for deletion.

 

CAUTION:

 

When using wildcards with the DELTREE command you should be extremely cautious because both directories and files with names that match the wildcard will be deleted.

 

Option

 

/Y - Carries out the DELTREE command without providing a prompt to confirm the deletion.

 

Example

 

To delete the directory CHAP including all files and subdirectories contained in it, enter DELTREE c:\chap

  


MSBACKUP

 

Type: External

 

Syntax:

 

MSBACKUP [setup_file][/BW|/LCD|/MDA]

 

Purpose: Used to backup or restore one or more files from one disk to another.

 

Discussion

 

With MS-DOS, Microsoft provides MSBACKUP for MS-DOS as well as for Windows. You determine if one or the other (or both) will be available by the choices you make during MS-DOS Setup. The discussion below relates only to backup for MS-DOS.

 

NOTE:

You can only run MSBACKUP from a hard disk, not a floppy disk.

 

MSBACKUP allows you to back up all files on a disk or only files that have changed since your last backup. You can also schedule backups to be performed automatically on a regular basis.

 

When MSBACKUP is used to back up your files, a backup catalog is created. This catalog contains information such as backed-up disk`s directory structure, the names, sizes, and attributes of the directories and files that were selected, the total number of files, backup date, etc.). If you want to restore one or more files, you can do so easily by loading the backup catalog and selecting the files to be restored from the backup set.

 

Setup_file specifies the setup file that is to be used to define the files to be backed up as well as the type of backup you want MSBACKUP to perform. The setup file is created when you save program settings and make file selections. You must give setup files the SET extension. If a setup file is not specified, MSBACKUP will use the DEFAULT.SET file.

 


Options

 

/BW - Starts MSBACKUP using a black-and-white color scheme.

 

/LCD - Starts MSBACKUP using a video mode compatible with laptop computers.

 

/MDA - Starts MSBACKUP using a monochrome display adapter.

 

Example

 

If you want to load a setup file named CHAP.SET that you have created to define a chapter backup procedure, enter,

 

msbackup chap

 


Copyright © 2001 Selfonline-Education. All rights reserved.