as for deleting directories and sub directories, you don't have to delete all file first if you dont want, just have to add a flag at the end. Bascially if you add the 1 at the end it will work like deltree. DirRemove ( "path" [,recurse] ) Parameters path Path of the directory to remove. recurse [optional] Use this flag to specify if you want to delete sub-directories too. 0 = (default) do not remove files and sub-directories 1 = remove files and subdirectories (like the DOS DelTree command) Example ; Delete C:\Test1 and all subdirs and files DirRemove("C:\Test1", 1)