How to unzip folder

Hi Team,

I am trying to unzip today folder from specific location. I am able to reach that to that path. Can anyone tell me is there any function or shortcut to unzip folder?

Try this. It uses powershell.

			//unzip to temp folder
			def outputDir = tmp_path + "\\pdf_tmp"				
				Resource.createFileFail(tmp_path + "\\unzip.bat")
			}catch(Exception e){
				log.warn("Unable to create unzip.bat script")
			cmd = 'powershell.exe -NoP -NonI -Command Expand-Archive ' +  zip_file_path + ' ' + outputDir;
			Resource.overwrite(tmp_path + "\\unzip.bat", cmd, "UTF-8");
			open(tmp_path + "\\unzip.bat");
1 Like

Ho does this work with a particular folder for extracting from and extracting to

Yes, just replace zip_file_path with source folder and outputDir destination folder