(I posted this over an hour ago but the system appears to have consumed my
previous submission, so I’ll try again.)
This one is not going to give up that easily.
The folder containing the files to be deleted also contains folders, which
are also to be deleted. It appears that Kill “C:\ParentFolder\*.*” only
removes the files, leaving the folders and a resulting problem of how to
delete them. The task is made particularly difficult by the fact that the
names of the folders contained in ParentFolder are, for all practical
purposes, unknown. They are recreated automatically every time a new
batch
of work orders is processed and carry names submitted by outside agencies.
There can at times be 50 or more such folders and they all contain files,
making it impossible to use RmDir, even if the folder names were known.
Do
correct me if I am wrong but, despite the objections, DeleteFolder,
followed
by CreateFolder, is beginning to look like the only viable solution.
Briefly, to reiterate the problem, the objective is to empty a folder, say
FolderName, of its contents, whatever they may be. Either of two methods
would be appropriate. The first is simply to flush the folder, leaving
the
resulting empty folder in place and the second is to delete the folder,
including its contents and then to recreate it.