DeleteFile canbt clear the folder

I am trying to clear the folder. I am trying to use deleteFile to do this. I am not sure how to specify all files in the filename service in of deletefile. I have tried ex.: c:\inbox*.* but it is not working. Is there specifc syntax for that?

Many Thanks


Yemi Bedu

That would be ideal. :slight_smile: But I am not sure how to extract the file names from the filenameList. I tried C:\inbox%filenameList% the same way as I am opening files via getFile within the loop but it is not working. Am I calling it right?

If you’re using the deleteFile service from the WmSamples package (hopefully a copy of it in your own package), set directory to C:\input and map filenameList directly to the filename input. It should work.


Sorry, that last post should have said C:\inbox.


Set Directory? Do you mean to put in C:\inbox in the filename of the deleteFile? When I do it I get an error that I cannot map b/c the value of filename is already. I even tried to put in the filename of the deleteFile %targetDirectory%%filenameList% (where %targetDirectory%% is C:\inbox) but still nothing. I think I am missing something.

The service has a separate input called ‘directory’. You can set the value of this to ‘C:\Inbox’. fileNameList contains a list of base filenames. Map fileNameList directly to the ‘filename’ input. The service will combine ‘directory’ and ‘filename’ when doing the deletion.


for some reson my deleteFile doesn’t have service in called ‘directory’ only fileName. I tried adding it and running it agian but no luck. I am using “PSUtilities.file:deleteFile”. Very strange. Anyway of getting that in?


There is a deleteFile service in WmSamples Package.Use this service.It has an input parameter called directory.


haha :slight_smile: it worked. You guys have saved my world again! :slight_smile: Thank YOU!