I have a directory with subdirectories and I want to extract every zip file...

I have a directory with subdirectories and I want to extract every zip file. Some of the subdirectories and zip files have brackets, pipelines and much more in the name. I don't want to directly extract the zip, it has to be extracted to a folder with the same name as the zip and then the zip must be deleted and then it finds another zip and keeps going until there are no more remaining zip files to extract.

How do I do it in powershell? Or .bat?

Attached: 68747470733a2f2f75706c6f61642e77696b696d656469612e6f72672f77696b6970656469612f636f6d6d6f6e732f322f32 (256x256, 8K)

Other urls found in this thread:

powershellscripts.com/
dostips.com/
justfuckinggoogleit.com/
stackoverflow.com/questions/27768303/how-to-unzip-a-file-in-powershell
warosu.org/g/?task=search&ghost=yes&search_text="How do I do it in powershell"
twitter.com/SFWRedditImages

Attached: 1524077919919.jpg (705x921, 394K)

Thanks for the bash script idea OP. It's close enough to my /Downloads cleaner/organizer anyways.

install cygwin and use find

Shell script:
findfiles() {
local path="$1"; shift
local cwd=$(pwd)
cd "$path"
for i in *; do
cd "$cwd"
[ -e "$path"/"$i" ] || continue
[ -d "$path"/"$i" ] && findfiles "$path"/"$i"
[ "${i%.[zZ][iI][pP]}" = "$i" ] && continue
unzip "$path"/"$i" -d "$path"/"${i%.[zZ][iI][pP]}"
rm -f "$path"/"$i"
done
}

Usage: findfiles "/path/to/a/folder"

Too lazy to even google, huh?

Search for similar powershell scripts here: powershellscripts.com/

Search for similar DOS batch files here: dostips.com/

Otherwise, go here:
justfuckinggoogleit.com/

simple just use GNU/Find

oh wait
>powershell
lul

To my knowledge, there is no pre-installed command line utility on Windows for extracting zip files, so using a batch script is a no-go. If you were on a Unix system, I would recommend you run "man unzip" and learn the basics of Bash. Since you're not, you should be using PowerShell.

PowerShell, unlike Bash and Batch, is not limited to calling external programs, and in fact, has access to the entirety of the .NET standard library. This includes the System.IO.Compression.ZipFile class, which you can use for your unzipping needs. See here for an example of its use:

stackoverflow.com/questions/27768303/how-to-unzip-a-file-in-powershell

It should be noted, however, that the class was added in .NET Framework 4.5, so make sure you are using at least PowerShell version 4, or you are using PowerShell Core

Windows has a binary called FORFILES
That's your first step, it's just an iterator

Windows 10 has bash now, doesn't it? Why are you punishing yourself?

>To my knowledge, there is no pre-installed command line utility on Windows for extracting zip files, so using a batch script is a no-go.

There are literally thousands of command line programs that will uncompress a .zip archive file. Personally, I still use the PKZIP 2.50 program.

Today, though, I would recommend the command line version of 7-zip for windows. You have to download the "Extras" package for 7-zip to get the command line 7-zip executable.

Yes, but are any of those utilities pre-installed? You could easily just get the Unix unzip utility and install it on Windows. If OP wants a pure PowerShell or pure batch solution, however, I will not assume they have access to any arbitrary computer program.

Jow Forums isn't preinstalled on your computer, either. Yet, here you are.

echo "import zippydoodoo\nzippydoodoo()" > zippy.py ; python zippy.py

no need to thank me

Attached: dogtrouble.jpg (640x800, 108K)

Jow Forums is a website, not an application.

Attached: 1523900937609.png (848x1200, 745K)

zip has a --junk-paths or some such argument.

I'm also interested.

but it sucks dick to download trillions of programs to get a useful command line environment

mfw windows cant recursively extract zips

do it like this
(gci C:\path -recurse -File)|%{ Expand-Archive -LiteralPath $_.FullName -DestinationPath $_.DirectoryName }

Attached: 019.png (1127x514, 17K)

>Yes, but are any of those utilities pre-installed?

What difference does that make? The zip/unzip programs are not part of any unix/linux kernel or unix/linux shell either.

Being pre-installed in your distribution doesn't make it any better/worse than any other program. There are distributions that do not have zip/unzip pre-installed.

Both powershell and the windows cli can run windows cli programs.

As far as I know, we're only talking about one function, a cli program that can uncompress a .zip archive, here.

warosu.org/g/?task=search&ghost=yes&search_text="How do I do it in powershell"
>not this dumb ass faggot again
sage goes in almost every field

a thread died for this you berk
go back to your
containment thread