Unzipping folders in Windows

Hi all,

I want to move a zipped folder to some windows machines, unzip the folder, cd into the unzipped folder and then run a command to do an installation.

Unfortunately, I cannt find a command that unzippes a folder in actionscriot or windows command line.

How do I go about this

If you want to use External Unzip Tools - you can use http://software.bigfix.com/download/redist/unzip32-6.0.exe

Source: Setting up OS Deployment in an air-gapped network

If you will filter out Task / Fixlets with Action contains unzip - you will Prefetch statements and execution of the utility.

You can also create PowerShell Script which will use the Expand-Archive command

You could also use a self extracting zip. I have that in a few of my tasks. Runs just like any other command you run.

I made this PowerShell variant some years ago. If I were to redo it, I’d pass the path arguments into the scripts instead of embedding them inside the script.

// vvv PASTE INTO OTHER ACTIONS vvv

// << UNZIP USING POWERSHELL
// Disable wow64 redirection on x64 OSes
action uses wow64 redirection {not x64 of operating system}
//
parameter "theArchive" = "REPLACE"
parameter "theDest" = "REPLACE"  // FOLDER NAME OF EXPANDED ARCHIVE
parameter "theTemp" = "{value of variable "TEMP" of environment}"
//
move __Download\{parameter "theArchive"} "{parameter "theTemp"}\{parameter "theArchive"}"
//
//    CREATEFILE
delete __createfile
createfile until END_OF_FILE
Expand-Archive -Path "{parameter "theTemp"}\{parameter "theArchive"}" -DestinationPath "{parameter "theTemp"}"
END_OF_FILE
//
delete unzip.ps1
move __createfile unzip.ps1
//
waithidden { pathname of file ((it as string) of value "Path" of key "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell" of native registry) } -ExecutionPolicy Bypass -File unzip.ps1
//
// REENABLE WOW64 REDIRECTION
action uses wow64 redirection {x64 of operating system}
// >> UNZIP USING POWERSHELL


// << CLEANUP
wait cmd /c del /q /s /f "{parameter "theTemp"}\{parameter "theArchive"}"
wait cmd /c rmdir /s /q "{parameter "theTemp"}\{parameter "theDest"}"
// >> CLEANUP


// ^^^ PASTE INTO OTHER ACTIONS ^^^
1 Like