DEL
This page was last modified 12:39, 1 June 2020 by Gdx. Based on work by Mars2000you.

Contents

Effect

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

Syntaxes

Under MSX-DOS 1

DEL <Device>:<Filename>

Note: DEL can be replaced by ERA or ERASE

Under MSX-DOS 2 / Nextor

DEL /S /H /P <Device>:\<Path>\<Filename> + <Device>:\<Path>\<Filename>...

Notes:

  • DEL can be replaced by ERA or ERASE
  • Character backslash (\) serves as a separator between the folders and the file name in MSX-DOS2. You don't have to put it after the colon of the device name. Backslash is replaced by the character yen (¥) on Japanese MSX or the character won (₩) on Korean MSX.
  • Character slash (/) serves to declare an option. You can put the options after the command or behind all other parameters.

Parameters

<Device> 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 delete. 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 1 or Erase all files (Y/N)? under MSX-DOS 2 / Nextor. Only entering Y will execute the deletion of all files. Note: since COMMAND2.COM 2.'40, the word 'Erase' is replaced by 'Delete'.

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 tool can be used immediately afterwards to restore them again.

/S is used to allow also the deletion of system files. This parameter is available only since COMMAND2.COM 2.40.

/H is used to allow also the deletion of hidden files. This parameter is only available under MSX-DOS 2 / 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 1 and higher

A>DEL TESTFILE.TXT
A>DEL B:TEXTFILE.TXT
A>DEL B:*.TXT

Under MSX-DOS 2 / Nextor

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

Related to

CONCAT, COPY, ERASE, FORMAT, MOVE, RENAME, UNDEL

Compatibility

MSX-DOS 1 with COMMAND.COM, MSX-DOS 2 / Nextor with COMMAND2.COM v2.20 and higher