{"id":131,"date":"2014-10-02T11:35:32","date_gmt":"2014-10-02T11:35:32","guid":{"rendered":"http:\/\/timbertops.co.uk\/blog\/?p=131"},"modified":"2019-04-04T22:22:32","modified_gmt":"2019-04-04T21:22:32","slug":"batch-extract-zip-files","status":"publish","type":"post","link":"https:\/\/timbertops.co.uk\/index.php\/2014\/10\/02\/batch-extract-zip-files\/","title":{"rendered":"Batch extract zip files"},"content":{"rendered":"<p><!--wp_fromhtmlpreview_devfmt--><\/p>\n<p><!--wp_fromhtmlpreview_devfmt--><\/p>\n<p>At work I needed to extract the contents from 600+ zip files to one place and select all, right click extract all did not work.<br \/>\n7-zip to the rescue, I used the command line version of 7-zip in a simple batch comand\u00a0to loop through the files and extract each one<br \/>\nthis code is written to be run from the same dir as the files to be extracted,<br \/>\n&#8220;C:\\Program Files (x86)\\7-Zip\\7z&#8221; needs to be the location of the commandline version of 7-zip<br \/>\n&#8220;%CD%Backup files %x.zip&#8221; this the format of the files to be extracted in this case it was a series of sequentially numbered files all called &#8220;Backup files 1,2,3,etc&#8221;<\/p>\n<p>It is run straight from the command prompt not as a batch script<\/p>\n<p>&#8220;C:\\extracted&#8221; is the destination of the extracted files<code lang=\"dos\">for \/l %x in (1, 1, 100) do \"C:\\Program Files (x86)\\7-Zip\\7z\" x\u00a0\"%CD%Backup files %x.zip\" -o C:\\extracted<\/code><\/p>\n<p>all in all about 20 mins work to write and test<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At work I needed to extract the contents from 600+ zip files to one place and select all, right click extract all did not work. 7-zip to the rescue, I used the command line version of 7-zip in a simple batch comand\u00a0to loop through the files and extract each one this code is written to &hellip; <a href=\"https:\/\/timbertops.co.uk\/index.php\/2014\/10\/02\/batch-extract-zip-files\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Batch extract zip files&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-131","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":5,"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":208,"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/131\/revisions\/208"}],"wp:attachment":[{"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/timbertops.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}