How to unzip (.7z ) extension file

Hello fellow,

I have a file with the extension (.7z)

BackUpReport.7z

To extract this file 7 zip is required. It is in my system. I have performed this manually but now I want to make it automated.

How can we do this in Uipath?

I tried with Extract Unzip/Zip activity but not working

Thanks in advanced

Best Regards,
Vrushali

Hi @Vrushali_Gave ,

Please check Extract files from .rar file - #4 by moenk

It should solve your issue

Best regards,
Marius

1 Like

@Marius_Puscasu Thank you for your response but It’s not worked for me

@Vrushali_Gave - Please check here for extract commands…

https://sevenzip.osdn.jp/chm/cmdline/commands/extract.htm

Hi @Vrushali_Gave - I tried this in my command line and it worked…

C:>“C:\Program Files\7-Zip\7z.exe” x C:\Users\giris\Documents\UiPath\Studio\7Zip\Test.7z -oC:\Users\giris\Documents\UiPath\Studio\7Zip

You can open the command line and use type into to try this…

I am still looking at how to use the same using ‘Start Process’ activity…

1 Like

@prasath17 Can we do this in invoke code activity? If yes then how can we do this?

@Vrushali_Gave - Here you go…

Dim exePath As String = “C:\Program Files\7-Zip\7z.exe”
Dim args As String = “e C:\Users\giris\Documents\UiPath\Studio\7Zip\Test.7z” + " -o"“C:\Users\giris\Documents\UiPath\Studio\7Zip”""
System.Diagnostics.Process.Start(exePath, args)

Before Extract
image

After Extract ==> Test Folder got extracted…
image

Update: With the same idea, I have tried using Start process, and it worked…please see below

Hope this helps…

2 Likes

@prasath17 I have tried both the solutions but it’s not worked for me
File is not getting extracted

@Vrushali_Gave - Please find the starter help here… 7Zip.zip (34.4 KB)

1 Like

@prasath17 Have look in the below attached screenshot

I have tried but the file is not an extracting

@Vrushali_Gave - first thing I noticed was there is no space after e…

“e D” instead i am seeing “eD” …Please replace the contents carefully as I provided…

@prasath17 Yes I noticed that thing and corrected it but still not working

@Vrushali_Gave - Please share your start process screenshot…Also please confirm your 7Zip.exe file location??

@prasath17 Okay sure, I’ll share but could you please try this using D:/ drive path folder? And let me know is it working or not

@Vrushali_Gave …I dont have D drive in my laptop…so I can’t try…

I have already provided the working code for you…I guess you have to figure out what you are doing incorrect…

@prasath17 I did it using C:/ drive and it’s worked but as per requirements the folder should be in D:/ drive and its not working

@Vrushali_Gave …That’s a good news…So for the time being…Extract the output to C drive and Using Move file activity move the extracted file…

In meantime, I will research on this…

1 Like

@prasath17 Okay. Thank you. I can apply this logic too but let me know if you find anything related this.

Best Regards,
Vrushali

@Vrushali_Gave - Could you please try this…

x d:\abc\abc\abc.7z -o"D:\data" *.* -r

Source Link

@prasath17 Tried but not working