Unzipping folder from BigFix

Hi All,

I am trying to extract a folder in my system with the help of BigFix action script but it is getting failed, below is the action script which i am using:

folder create “C:\test123”

// Download UnZip utility
prefetch unzip.exe sha1:1adbac6e61446e95e8ad4a76d2c8f15cb55f4960 size:167936 http://BFDEMO:52311/Uploads/1adbac6e61446e95e8ad4a76d2c8f15cb55f4960/unzip-5.52.exe.tmp “C:\test123”

//Download zip folder on the system

prefetch 1adbac6e61446e95e8ad4a76d2c8f15cb55f4960 sha1:1adbac6e61446e95e8ad4a76d2c8f15cb55f4960 size:77984 http://BFDEMO:52311/Uploads/1adbac6e61446e95e8ad4a76d2c8f15cb55f4960/unzip-5.52.exe.tmp sha256:540990a579a1e466e9ca0b2f4cc3eb97ddbd962b66d90d3b77e4480a6821f759
extract 1adbac6e61446e95e8ad4a76d2c8f15cb55f4960 “C:\test123”

// extract the folder
waithidden C:\test123\unzip.exe -o “C:\test123\KK.zip” -d “C:\test123”

Please let me know if there is issue in my script or what should i change,the script is getting failed on the Extract part.
Thanks in advance.

regards,
KK

Your prefetch statement for unzip.exe doesn’t look correct - is it merged with a ‘extract’?

The Extract command doesn’t allow specifying a destination folder - it ways extracts a file in the '__Download` folder, and extracts into the same folder. You need to move the file after extracting. https://developer.bigfix.com/action-script/reference/file/extract.html

It isn’t clear what you are really trying to do, but the script suggests you are downloading the same source file (unzip-5.52.exe.tmp) twice, then using one copy to unzip the other.

Hi @trn

sorry for the copy paste issue below is the actual script which i am testing in BigFix:

// Creating a test folder
folder create “C:\test123”

// Download UnZip utility
prefetch unzip.exe sha1:1adbac6e61446e95e8ad4a76d2c8f15cb55f4960 size:167936 http://BFDEMO:52311/Uploads/1adbac6e61446e95e8ad4a76d2c8f15cb55f4960/unzip-5.52.exe.tmp “C:\test123”

//Download zip folder on the system

prefetch eda921304fbb54656cb8bc373f7e1294c5d5cac9 sha1:eda921304fbb54656cb8bc373f7e1294c5d5cac9 size:639602302 http://BFDEMO:52311/Uploads/eda921304fbb54656cb8bc373f7e1294c5d5cac9/KK.zip.tmp sha256:676e632a92d18d707f5256e832f253324c4d3907a7984d1c903eeb4e14b7bba0
extract eda921304fbb54656cb8bc373f7e1294c5d5cac9 “C:\test123”

// Unzip the folder
waithidden C:\test123\unzip.exe -o “C:\test123\KK.zip” -d “C:\test123”

The last part in the script for unzipping the folder is getting failed.

I used the below fixlet as an refrence -

https://bigfix.me/fixlet/details/3933

Thanks in advance.

Hi @JasonWalker Is the extract command used for unzipping a folder ? Cos when i am trying to execute the same command from Fixlet debugger i am getting error stating “Unable to extract archive file”

Your prefetch of the unzip is all wrong - either use the lines from the fixlet you are using as your reference to fetch the unzip file or use your own prefetch then extract the file (you cannot simply take the destination for the extract, add it to the prefetch statement and expect it to work.