Author Topic: 7zip  (Read 5526 times)

Offline fullmetaljacket

  • Contributor
  • ***
  • Posts: 4
7zip
« on: September 25, 2009, 12:07:24 am »
I did a search for 7zip but nothing came up so making this one. 

Right now i'm using winrar for alt.binz to unrar my files, but can 7zip work with alt.binz ?   If so, how do I set it up so that it uses 7zip automatically

Offline Ascathon

  • Contributor
  • ***
  • Posts: 608
    • vandenekker.com
Re: 7zip
« Reply #1 on: September 25, 2009, 08:29:39 am »
If you extract files manually, you can use the program of your choice. This has nothing to do with AltBinz which uses a semi built-in extracter.
Save the Whales - Harpoon a Honda

Offline davidq666

  • Contributor
  • ***
  • Posts: 1302
  • Watashi Wa Ero Desu!
Re: 7zip
« Reply #2 on: September 25, 2009, 10:39:56 am »
I did a search for 7zip but nothing came up so making this one.  

Right now i'm using winrar for alt.binz to unrar my files, but can 7zip work with alt.binz ?   If so, how do I set it up so that it uses 7zip automatically

as ascathon already meantioned by default alt.binz uses no external programm to unrar stuff. if u want that u would need to write a script that does what u want with the program of ur choise. alt.binz could then execute the script after download and par-check...

Offline Hecks

  • Contributor
  • ***
  • Posts: 2011
  • naughty cop
Re: 7zip
« Reply #3 on: September 25, 2009, 06:20:07 pm »
7-Zip does indeed have a commandline version that can be called from a script on completion:

http://www.7-zip.org/download.html

Code: [Select]
7z.exe x D:\stuff\archive.rar E:\extracted\


It needs version 0.26.1 of Alt.Binz, though:

https://www.altbinz.net/wiki/Execute_Command_on_Completion
« Last Edit: September 25, 2009, 06:29:19 pm by Hecks »

Offline fullmetaljacket

  • Contributor
  • ***
  • Posts: 4
Re: 7zip
« Reply #4 on: September 25, 2009, 09:01:23 pm »
thanks guys, much appreciated

Offline MrbLOB9000

  • Contributor
  • ***
  • Posts: 43
Re: 7zip
« Reply #5 on: October 31, 2009, 01:28:45 am »
but I don't want to un-archive everything with 7zip, just the ones that actually are 7zipped...

Offline MrbLOB9000

  • Contributor
  • ***
  • Posts: 43
Re: 7zip
« Reply #6 on: October 31, 2009, 04:14:59 am »
7-Zip does indeed have a commandline version that can be called from a script on completion:

http://www.7-zip.org/download.html

Code: [Select]
7z.exe x D:\stuff\archive.rar E:\extracted\


that's not the right syntax, it should be:

7z.exe x -oE:\extracted\ D:\stuff\archive.7z

Offline MrbLOB9000

  • Contributor
  • ***
  • Posts: 43
Re: 7zip
« Reply #7 on: October 31, 2009, 05:06:47 am »
and I got it!

You must have the real 7zip app installed for this script to work. Create a .bat file named 7zip.bat.  Copy the following into that file:

Code: [Select]
FOR %%F IN (%1\*.7z.001) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"

FOR %%F IN (%1\*.7z) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"


for default execute command put: C:\location_of_script\7zip.bat "$d" "$u"

The first line finds any split 7zip archives and unzips them, the second unzips any regular non-split 7zip archives.

anyone know if there's a way to do a cleanup and delete par2, sfv and 7zip files but only if it's correctly unzipped?

edit:
if you want the script to move any remaining files you'd want to keep, delete the 7zip files onces they've been extracted correctly and then delete the folder if it's empty then here's the script containing that.

Code: [Select]
FOR %%F IN (%1\*.7z.001) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"
IF ERRORLEVEL 1 GOTO Failed

FOR %%F IN (%1\*.7z) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"
IF ERRORLEVEL 1 GOTO Failed

move %1\*.nfo %2
move %1\*.jpg %2
move %1\*.png %2
move %1\*.wmv %2
move %1\*.avi %2
move %1\*.mpg %2

del %1\*.7z.*
del %1\*.7z
del %1\*.par2

rem @echo off
dir %1|find " 0 File(s)" > NUL
if errorlevel 1 goto notempty

dir %1| find " 2 Dir(s)" > NUL
if errorlevel 1 goto notempty

rd %1

:Failed
:notempty
« Last Edit: October 31, 2009, 06:48:45 am by MrbLOB9000 »

Offline MrbLOB9000

  • Contributor
  • ***
  • Posts: 43
Re: 7zip
« Reply #8 on: November 05, 2009, 04:35:44 am »
added code to make it only run if it found 7z files.  also added for it to delete sfv and move mkv files.

Code: [Select]

rem in nzb#2 put this for default execution command: C:\folder\7zip.bat "$d" "$u"
If exist %1\*.7z.001 GOTO Contains7z
If exist %1\*.7z GOTO Contains7z

GOTO notempty

:Contains7z
FOR %%F IN (%1\*.7z.001) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"
IF ERRORLEVEL 1 GOTO Failed

FOR %%F IN (%1\*.7z) DO "C:\Program Files\7-Zip\7z.exe" x -o%2 "%%F"
IF ERRORLEVEL 1 GOTO Failed

move %1\*.nfo %2
move %1\*.jpg %2
move %1\*.png %2
move %1\*.wmv %2
move %1\*.avi %2
move %1\*.mpg %2
move %1\*.mpeg %2
move %1\*.mkv %2

del %1\*.7z.*
del %1\*.7z
del %1\*.par2
del %1\*.sfv

rem @echo off
dir %1|find " 0 File(s)" > NUL
if errorlevel 1 goto notempty

dir %1| find " 2 Dir(s)" > NUL
if errorlevel 1 goto notempty

rd %1

:Failed
:notempty

« Last Edit: November 05, 2009, 04:39:33 am by MrbLOB9000 »