Delete a folder with a wildcard character
majx767
![]()
- Joined: Jun 28, 2011
- Posts: 3
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.
c:\appdata\cASM.FC1ACB96B7779CF44525BCCBAB5D3A50D96CBAC3.1
I've tried and this doesn't work.
C:\AppData\cASM.*
Any ideas?
majx767
![]()
- Joined: Jun 28, 2011
- Posts: 3
That was:
Delete Folder C:\appdata\CASM.*
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2330
majx767
![]()
- Joined: Jun 28, 2011
- Posts: 3
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.
DeleteFolder.vbs
Dim FSO, Folder
set FSO=CreateObject("Scripting.FileSystemObject")
Folder="C:\Users\guest\AppData\Roaming\casm.*"
FSO.DeleteFolder(Folder)
Samantha
![]()
- Joined: Apr 23, 2010
- Posts: 2330