Why is it literally impossible to unzip files like this with a script inside a directory with multiple folders with the...

Why is it literally impossible to unzip files like this with a script inside a directory with multiple folders with the click of one button?

Attached: 4444444444444.webm (872x742, 836K)

Other urls found in this thread:

stackoverflow.com/questions/2212643/python-recursive-folder-read
stackoverflow.com/questions/3451111/unzipping-files-in-python
stackoverflow.com/questions/1994549/fast-way-to-read-filename-from-directory
thewindowsclub.com/remove-click-context-menu-items-editors
pastebin.com/raw/khr50zyv
twitter.com/NSFWRedditVideo

If a script can't do it, write an executable that can

>not being able to write a script that does this shit

get out

you're not supposed to extract cbz files tho

Doesn't matter if it's zip or cbz, it's still impossible to recursicely extract it into a folder with the zip's name.

what do you think a cbz file is

for comic viewers

>, it's still impossible to recursicely extract it into a folder with the zip's name.
there is literally powershell code snippet on stackoverflow that does exactly this

>comic viewers
Really bad image viewers that have .zip support?

cbz literally stands for comic book zip

and they are more handy for reading

Any image reader is just as good.
The point I was making is comic book readers are stupid. Just use any old image reader, since it'll probably be better and more free.

none of it works

>more free.
wat?

into ze search he writes *.cbz
selects all niptoon archives, right clicks and chooses to extract to *
then he deletes said archives ezpz ok thank you

Man, it's been a while since I last had to write a batch script, but shouldn't something like this do the job?

@echo off

FOR /D %%A IN (*) DO (
cd "%%A"
FOR %%B IN (*.cbz) DO (
7za x "%%B"
del "%%B"
)
cd ..
)

no, because I have filenames with pipelines, brackets and weird unicode letters

ahhh, it's you again.

Well then you have shit file names. Whose fault is that

Windows.

>a C script is fundamentally different from a python/shell script
hmm

You have posted this thread every day for the last week.

You could have manually done this in that time.

# Use UNC path
>cd "\\?\C:\myshittyanime\"

>gci -Filter "*INVALID_CHAR*" -Recurse | % { Rename-Item -LiteralPath "$($_.FullName)" ($_.FullName -replace 'INVALID_CHAR','WHATEVER') }

wow

Attached: 2018-04-25-095906_585x35_scrot.png (585x35, 5K)

To clarify on this, windows support is kinda shitty, some programs support long paths/unicode in paths, other programs don't. Powershell with UNC paths DOES support everything that can exist AFAIK - eg, if some program was able to create/name it, that will be able to work with it.

Attached: seriousbusiness2.jpg (450x548, 121K)

i'll paypal or send crypto in $30 if you can make a script

this

how hard is this, OP. i prefer winrar though, the extract options are better

I already posted a powershell snippit above that you could use as a template, what's wrong with it? What are the bad characters you have and what do you want them replaced with?

Use Powershell or WSL, I'm pretty sure you can do this with a single command

I don't want to replace anything. I just want to make sure every zip extracts its content to a folder with the name of the zip in its current folder and then it gets rid of the zip and moves on to the next zip.

Comic viewers still unpack archives in memory or a temp directory. The only advantage is size reduction, and handling of metadata formats that nobody uses.

retard use the search function in explorer

Does this work?

Attached: extract.webm (1020x644, 474K)

What's wrong with the scripts people have posted for you on previous days?

OP is a faggot

stackoverflow.com/questions/2212643/python-recursive-folder-read
stackoverflow.com/questions/3451111/unzipping-files-in-python
stackoverflow.com/questions/1994549/fast-way-to-read-filename-from-directory

Oh, and if you want to get fancy

thewindowsclub.com/remove-click-context-menu-items-editors

They were either
1. for Linux, I'm not installing a distro to do basic shit.
2. didn't work

Then write your own. Python is easy as fuck and you could probably create some Frankenstein that does exactly what you want.

Don't use python, just use powershell.

>a compiled language is not fundamentally different from an interpreted one

>languages are either compiled or interpreted, rather than implimentations

I realize you're probably just wasting people's time for lols but here you go, should work as is if the 7zip path and extensions are correct.
# Ensure your 7z path is correct here
$7z = 'C:\Program Files\7-Zip\7z.exe';

# Any other extensions you want to catch?
$exts = @('.cba','.7z','.zip');

# Specify the parent folder in UNC style here;
cd "\\?\C:\MyYaoiComicBooks";

$files = (gci -Recurse | ? { $exts -contains $_.Extension});
Write-Host "Extracting the following files matching ($exts)...";
$files | % {
$dst = "$(($_.FullName))_Extracted";
mkdir $dst -ErrorAction Ignore;
cd $dst;
echo "&$7z x `"$($_.FullName)`"";
&$7z x "$($_.FullName)";
remove-item -LiteralPath $_.FullName;
};

Attached: aw3splU.gif (320x240, 991K)

This stupid thread again...

Attached: 1523999727863.jpg (979x1200, 102K)

I'm not actually trolling, I 'll get back at you tomorrow after work to see if the script works

Actually I decided to try it and it doesn't work. It says some paths can't be found and it's extracting everything in one folder. I want it to be extracted like in my webm. The zip gets extracted to a folder with the zip's name and the zip gets deleted afterwards and then it moves on to the next zip.

actually was going the other way myself, zipping up directories.
easy to do with find

If you truly arent trolling try posting actual error messages and the dir tree it creates.

Attached: daeff87d6f09fce605a2c2dc2a1c2951.jpg (500x400, 61K)

The directory is at E:\1

# Ensure your 7z path is correct here
$7z = 'C:\Program Files\7-Zip\7z.exe';

# Any other extensions you want to catch?
$exts = @('.cbz','.7z','.zip');

# Specify the parent folder in UNC style here;
cd "\\?\E:\1";

$files = (gci -Recurse | ? { $exts -contains $_.Extension});
Write-Host "Extracting the following files matching ($exts)...";
$files | % {
$dst = "$(($_.FullName))_Extracted";
mkdir $dst -ErrorAction Ignore;
cd $dst;
echo "&$7z x `"$($_.FullName)`"";
&$7z x "$($_.FullName)";
remove-item -LiteralPath $_.FullName;
};


error
pastebin.com/raw/khr50zyv

Attached: f.png (812x791, 278K)

Alright, that was my fuckup.

CD was failing due to i missed a -LiteralPath (necessary for these fucked up paths). Try

# Ensure your 7z path is correct here
$7z = 'C:\Program Files\7-Zip\7z.exe';

# Any other extensions you want to catch?
$exts = @('.cbz','.7z','.zip');

# Specify the parent folder in UNC style here;
cd "\\?\D:\inc\test123";

$files = (gci -Recurse | ? { $exts -contains $_.Extension});
Write-Host "Extracting the following files matching ($exts)...";
$files | % {
$dst = "$(($_.FullName))_Extracted";
mkdir $dst -ErrorAction Ignore;
cd -LiteralPath $dst;
echo "&$7z x `"$($_.FullName)`"";
&$7z x "$($_.FullName)";
remove-item -LiteralPath $_.FullName;
};

Attached: 1519694712013.gif (440x512, 267K)

it works, thank you so much

is there a chance for it to skip a zip or accidentally delete a zip before extracting it

What's wrong with using 7zip to extract the whole directory?

how

Exactly how op did in the webm

install gentoo

There is a chance 7zip could fail, try this if you want better messaging and for it to only delete the files on success.

# Ensure your 7z path is correct here
$7z = 'C:\Program Files\7-Zip\7z.exe';

# Any other extensions you want to catch?
$exts = @('.cbz','.7z','.zip');

# Specify the parent folder in UNC style here;
$parent = "\\?\D:\inc\test123";

cd $parent;
$files = (gci -Recurse | ? { $exts -contains $_.Extension});
Write-Host "Extracting the following files matching ($exts)...";
$files | % {
$dst = "$(($_.FullName))_Extracted";
mkdir $dst -ErrorAction Ignore > null;
cd -LiteralPath $dst;
&$7z x "$($_.FullName)" > null;

if ($LASTEXITCODE -eq 0) {
remove-item -LiteralPath $_.FullName;
write-host -ForegroundColor Green "Extracted and removing archive: $($_.FullName))";
} else {
write-host -ForegroundColor Red "Error extracting archive, skipping removal: ($($_.FullName))";
cd $parent;
remove-item -LiteralPath $dst -Recurse -Confirm:$false -ErrorAction Ignore;
}
};

Why are you extracting cbz's? The entire purpose of them is to be used with a comic book viewer.

There's your problem.

wow

Why can't you unzip multiple folders at once, creating a separate folder for each folder unzipped? It always puts all the unzipped folders into one folder.

>Andou Hiroyuki

Attached: 1368120281912.jpg (680x680, 101K)

Because you have hit the end of what GUIs are good for. GUI is great if you want to do a task that the developer has thought of. This is not one of those.

Command line lets you make mini-programs to perform complex actions that you describe to the computer.

I'm pretty sure its possible with Directory Opus

or with a bash script.

Honestly the biggest part of the effort would be rendering the GUI to have the button to click.

Yes.
However that doesn't mean that there is no reason not to open them. They are just zip files with the extention changed. I open them to remove credit pages or add in proper cover images.

The expression after '&' in a pipeline element produced an object that was not valid. It must result in a command name, a script block,
or a CommandInfo object.
At F:\1\2\xd2.ps1:14 char:6
+ &$7z x "$($_.FullName)" > null;
+ ~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : BadExpression

I got this error with that script

>I open them to remove credit pages or add in proper cover images.
I was under the impression that you can do that without extracting them. There are still valid reasons to extract them though.

If you can I don't know how or have a viewer that can.

Not sure what the issue here is, just try removing the
> null
from the offending line, it's just there to clean up the output, its not necessary.

oh, maybe it's parsing in a weird way (not sure why PS would do that.) you could try this modification
(&$7z x "$($_.FullName)") > null;

It's not literally impossible. You're just a lazy ass and want people to do your work for you.

Why are you extracting CBZs
The whole point of renaming ZIPs to CBZ is to open them in a reader without extracting them