ERASE (MSX-DOS)
This page was last modified 16:12, 13 February 2020 by Mars2000you.

Contents

Effect

Deletes file(s) of the disk in a drive.

Syntaxes

Under MSX-DOS

ERASE [<devicename>:]<filename>

Note: ERASE can be replaced by ERA or DEL

Under MSX-DOS 2 / Nextor

  • ERASE [<devicename>:][\<path>][\]<filename> [/H] [/P] [+[<devicename>:][\<path>][\]<filename> [/H] [/P]]]...
  • ERASE [/H] [/P] [<devicename>:][\<path>][\]<filename> [+[<devicename>:][\<path>][\]<filename>]...

Notes:
- ERASE can be replaced by ERA or DEL
- Character backslash (\) is used in MSX-DOS 2 / Nextor. It is replaced by the character yen (¥) on Japanese MSX.

Parameters

<devicename> is the name for used device. It can only be a disk drive.

If you don't specify the drive, the computer will delete file(s) on the currently active drive (by default, it's drive A:)

Device type Device name Remark
Disk drive A, B, C, D, E, F, G, H A floppy disk interface can control until 2 drives.


<path> is used to specify the location in folders of file to load. Each folder name in path are separate by a backslash (\). This parameter is only available under MSX-DOS 2 / Nextor.

<filename> is the file name to delete. Wildcards can replace some characters in filename to get several files. The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches any sequence of characters, whereas the question mark matches any single character.

If you want to delete all the files on the specified disk and path, you can use *.* that is a very dangerous operation. That's why the computer will then ask confirmation with Are you sure (Y/N)? under MSX-DOS or Erase all files (Y/N)? under MSX-DOS 2 / Nextor. Only entering Y will execute the deletion of all files.

The same security measure will act in case you have asked to delete a folder without specifying file(s) under MSX-DOS 2 /Nextor.

If files are deleted unintentionally on a disk that was formatted under MSX-DOS2 / Nextor, then the UNDEL command may be used immediately afterwards to restore them again.

/H is used to allow also the deletion of hidden files. This parameter is only available under MSX-DOS2 / Nextor.

/P is used to allow a pause at the end of the screen when displaying error messages for files that can't be deleted, because they are marked as 'read only' or for another reason. This parameter is only available under MSX-DOS 2 / Nextor.

MSX-DOS 2 / Nextor allows to delete simultaneously several specified (series of) files with the + part of the mentioned syntaxes. In this case, the /H and /P parameters will apply to all these files when they precede all the other parameters.

Examples

Under MSX-DOS and higher

A>ERASE TESTFILE.TXT
A>ERASE B:TEXTFILE.TXT
A>ERA B:*.TXT

Under MSX-DOS 2 / Nextor

A>ERASE *.COM /H
A>ERASE B:\UTIL\*.COM + B:\UTIL\*.BAT
A>ERA B:\UTIL

Related to

COPY, DEL, FORMAT, RENAME, UNDEL

Compatibility

MSX-DOS / MSX-DOS 2 / Nextor