2017-10-10 14:55:21 +00:00
|
|
|
The [[KILL]] statement deletes a file designated by a [[STRING]] value or variable.
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
{{PageSyntax}}
|
2017-10-10 14:55:21 +00:00
|
|
|
: [[KILL]] {{Parameter|fileSpec$}}
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
* {{Parameter|fileSpec$}} is a literal or variable string path and filename. Wildcards * and ? can be used with caution.
|
2015-08-02 12:12:44 +00:00
|
|
|
::'''*''' denotes one or more wildcard letters of a name or extension
|
|
|
|
::'''?''' denotes one wildcard letter of a name or extension
|
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
* {{Parameter|fileSpec$}} can include a path that can be either relative to the program's current location or absolute, from the root drive.
|
|
|
|
* [[KILL]] cannot remove an [[OPEN]] file. The program must [[CLOSE]] it first.
|
2019-04-15 01:15:33 +00:00
|
|
|
* If the path or file does not exist, a "File not found" or "Path not found" [[ERROR Codes|error]] will result. See [[_FILEEXISTS]].
|
|
|
|
* {{InlineCode}}[[SHELL]] "DEL /Q " + fileName${{InlineCodeEnd}} does the same without a prompt or verification for wildcard deletions.
|
|
|
|
* {{InlineCode}}[[SHELL]] "DEL /P " + fileName${{InlineCodeEnd}} will ask for user verification.
|
2017-10-10 14:55:21 +00:00
|
|
|
* Cannot delete folders or directories. Use [[RMDIR]] to remove empty folders.
|
|
|
|
* '''Warning: files deleted with [[KILL]] will not go to the Recycle Bin and they cannot be restored.'''
|
2015-08-02 12:12:44 +00:00
|
|
|
|
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
{{PageExamples}}
|
2015-08-02 12:12:44 +00:00
|
|
|
{{CodeStart}}
|
2021-02-11 11:41:53 +00:00
|
|
|
KILL "C:\QBasic\data\2000data.dat"
|
2015-08-02 12:12:44 +00:00
|
|
|
{{CodeEnd}}
|
|
|
|
|
|
|
|
|
2017-10-10 14:55:21 +00:00
|
|
|
{{PageSeeAlso}}
|
2015-08-02 12:12:44 +00:00
|
|
|
* [[RMDIR]], [[FILES]], [[SHELL]], [[OPEN]]
|
|
|
|
* [[CHDIR]], [[MKDIR]], [[NAME]]
|
|
|
|
* [[_FILEEXISTS]], [[_DIREXISTS]]
|
|
|
|
|
|
|
|
|
2019-04-15 01:15:33 +00:00
|
|
|
{{PageNavigation}}
|