RMDIR removes a directory.
Syntax:RetVal = RMDIR(DirectoryName AS STRING) Return Value:
Parameters:
|
👉 RMDIR can remove only one directory each time it is invoked. In the following example, only the directory "BCX" can be removed. Also, the directory must be empty of files for RMDIR to remove the directory.
DIM DirectoryName$ DIM RetVal% DirectoryName$ = "C:\Temp\BCX" RetVal% = RMDIR(DirectoryName$) IF RetVal% = 0 THEN PRINT "RMDIR removed the directory " & DirectoryName$ ELSEIF RetVal% = -1 THEN PRINT "RMDIR could not remove the directory." END IF
RMDIR removed the directory C:\Temp\BCX