Micro Focus QTP (UFT) Forums
Deleting a folder after unzipping - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Deleting a folder after unzipping (/Thread-Deleting-a-folder-after-unzipping)



Deleting a folder after unzipping - Irishman - 10-17-2011

I am trying to write a script for my company. I got everything done except for after I have the program download the zip file and unzip the folder, it runs the setup in the folder after that is done it deletes the zip file but it will not delete the folder. Instead states "Permission Denied." I have tried the following:

Try #1

Code:
Dim fso2
Set fso2 = CreateObject("Scripting.FileSystemObject")
Set fldr= fso2.DeleteFolder(ExtractTo)

Try #2

Code:
Dim objFSO3
Set objFSO3 =  CreateObject ("Scripting.FileSystemObject")
objFSO3.DeleteFolder ExtractTo,True

I am using QTP 10. Now if I unzip the file, it does delete. Now this folder is large about 750 MB which is the reason I want to delete it.

Please help