Kaseya Community

Command Line Zip Extraction

  • I am attempting to write a script to install software. It is packaged as a zip(not self-extracting). I need it to simply unzip once the WRITE file command is complete.

    Legacy Forum Name: Command Line Zip Extraction,
    Legacy Posted By Username: rx7kevin
  • This means winzip must be installed on the target machine. Perhaps include a check at the start to make sure it;s installed and run a winzip install script if it's not?

    Also look at winrar as this is much easier to install as it supportscommand line basedsilent install.

    If Winzip is installed you will need the command line option pack (on any machines you want to run the script on):

    http://www.winzip.com/prodpagecl.htm (once again winzip doesn't seem to offer the option to install this silently, WinRAR is looking more attractive by the minute!)

    This allows you to use winzip from a command line. Create a new step in your script of type 'Execute Shell Command'.

    Type the command into the script step, e.g:

    "C:\Program Files\WinZip\wzunzip" myfiles.zip c:\temp





    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: raybarber
  • Download winrar and create your archive.

    then click on the SFX button at the top.
    Select the Add new SFX module
    Click on Advanced SFX options
    Path to extract c:\temp
    Click Modes Tab and select Hide all under silent mode.

    Thats it! Execute this file with the kscrips.


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: sourceminer
  • I have user WinRar to create a command line exe of my multiple file install.

    I have made the script Write the file to #AgentDrv#Temp\rbs\rbs851.exe

    When I run the next line Execute Shell Command

    #agentDrv#temp\rbs\rbs851.exe -o+ -inul e

    -o+ = overwrite files.

    -inul = suppress messages.

    e = extract to current directory.

    I have made this step run once without the switches, but it extracted the files to C:\Windows\system32 folder. That was a fun mess!

    what command or switches need to be used to get the file to extract to :

    #agentDrv#temp\rbs\ ???


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: rx7kevin
  • By default CMD works in the System32 folder, that's why we can type stuff like defrag and chkdskwithout using the full path C:\Windows\System32\defrag.exe. I honestly haven't had to change the working directory in a Kaseya script yet, so I'm not sure how exactly that would work (two shell commands one after the other -- but do they both work in the same cmd.exe process or separate ones? Separate ones would defeat the purpose).

    It might be easier to turn your shell commands into a batch file that changes the working directory and then installs the program. Then you can just have Kaseya run the batch file.I believe you can pass batch files a variable, but I'm not certain on that. Someone else with more knowledge might be a better help there.

    Or see if the program you want to install has a destination switch. That would be the easiest.


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: rogers
  • I use this if I ever need command line zipping and unzipping.

    http://portableapps.com/apps/utilities/7-zip_portable

    Does many diffrent compression styles plus its own.

    God Bless,

    Marty


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: MissingLink
  • I also use 7-zip: it works fine and it's free.

    Claudio


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: achab
  • I also use 7-zip: it works fine and it's free.

    Claudio


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: achab
  • 7-Zip rocks the Kazba!

    Gamer-X


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: Gamer-X
  • Anyone have some examples of using 7-Zip. Figure no use sitting around reinvening the wheel. Can't seem to find all the command lines. I an trying to write a script to install NOD32 using a xml config file for all its settings so it can be silent. Need somrthing liek this though to unzip everything.

    Thanks


    Legacy Forum Name: Script Discussion,
    Legacy Posted By Username: toddbn