02-08-2013, 12:47 PM
i need code to extract and save a file from zip folder using VB Script in QTP.
Could you please any one help me this.
Regards
Karthik
Could you please any one help me this.
Regards
Karthik
|
Extract and save a file from zip folder using VB Script
|
|
02-08-2013, 12:47 PM
i need code to extract and save a file from zip folder using VB Script in QTP.
Could you please any one help me this. Regards Karthik
06-29-2016, 02:19 PM
(This post was last modified: 06-29-2016, 02:20 PM by Ankesh.
Edit Reason: Added code block
)
You can use the below code.
Code: Function UnzipFile(zipFile,ExtractTo)
'The location of the zip file.
'ZipFile="C:\Test.Zip"
'The folder the contents should be extracted to.
'ExtractTo="C:\Test\"
'If the extraction location does not exist create it.
Set fso = CreateObject("Scripting.FileSystemObject")
If NOT fso.FolderExists(ExtractTo) Then
fso.CreateFolder(ExtractTo)
End If
'Extract the contants of the zip file.
set objShell = CreateObject("Shell.Application")
set FilesInZip=objShell.NameSpace(ZipFile).items
objShell.NameSpace(ExtractTo).CopyHere(FilesInZip)
Set fso = Nothing
Set objShell = Nothing
End Function |
|
« Next Oldest | Next Newest »
|
| Possibly Related Threads… | |||||
| Thread | Author | Replies | Views | Last Post | |
| Executing via create "RES"xx folder? | nishitd | 0 | 1,691 |
03-07-2018, 01:09 AM Last Post: nishitd |
|
| Sending json file request and validating response in soap UI tool using Groovy script | smiley | 0 | 4,317 |
07-19-2017, 04:58 PM Last Post: smiley |
|
| code for validation to create a sub folder | smiley | 0 | 1,886 |
10-19-2016, 10:08 PM Last Post: smiley |
|
| [UFT] Close opened folder | robertosalemi | 1 | 3,878 |
02-10-2016, 07:06 PM Last Post: robertosalemi |
|
| qtp script for updating values in xml file | automation2012 | 3 | 12,308 |
11-30-2015, 11:07 AM Last Post: Lavanya N |
|