Delete a folder with a wildcard character
I have an application that creates a unique folder name each time an iteration occurs and needs to be deleted after a job has completed.
I’ve tried using wildcard characters to delete it but nothing has worked. The only commonality with the folder name is the beginning four characters are always the same.
I’ve tried and this doesn’t work.
Welcome to our Forum! The application that created this folder, is probably locking this folder, and therefore you cannot delete it. Try terminating the application prior to deleting the folder. To get the folder name, all you will need to do is use the “Get Subfolders in Folder” action, and then, within “For Each” a loop, check if the %CurrentFolder.Name% starts with cASM, if so, then Exit the Loop, and delete the %CurrentFolder% I’m attaching a sample job to help you understand the jobflow. Samantha
The information was really helpful and will be implemented. I also created a vbs script that I called from WinAutomation that was a little easier. Here’s the code if anyone would find this useful.
Dim FSO, Folder
Cool! Thanks for sharing! Btw… In WinAutomation v.4 you’ll also be able to run vb scripts from within WinAutomation! Samantha
You must be logged in to reply to this topic.