{"id":2361,"date":"2019-03-25T17:39:13","date_gmt":"2019-03-25T20:39:13","guid":{"rendered":"http:\/\/xexeu.elipse.com.br\/pt\/extracting-zip-files-via-scripts\/"},"modified":"2019-03-25T17:39:13","modified_gmt":"2019-03-25T20:39:13","slug":"extracting-zip-files-via-scripts","status":"publish","type":"post","link":"https:\/\/kb.elipse.com.br\/en\/extracting-zip-files-via-scripts\/","title":{"rendered":"Extracting ZIP files via scripts."},"content":{"rendered":"<div style=\"text-align: justify;\"><span style=\"FONT-WEIGHT:bold\">Question:<\/span><br style=\"FONT-WEIGHT:bold\"><br \/>Can I extract a ZIP file via scripts?<\/p>\n<p><span style=\"FONT-WEIGHT:bold\">Solution:<\/span><\/p>\n<p>Yes, you can. For example:<\/div>\n<p><br style=\"BACKGROUND-COLOR:rgb(204,204,204);FONT-STYLE:italic\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(51, 153, 102); font-family: Courier New;\">&#8216;ZIP file to be extracted:<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">pathToZipFile=&#8221;C:\\Folder1\\MyZIPfile.zip&#8221; <br \/><\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(51, 153, 102); font-family: Courier New;\"><font style=\"color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: Courier New;\" color=\"#000099\"><span style=\"color: rgb(51, 153, 102);\">&#8216;Folder of destination:<\/span><br \/><\/font><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">extractTo=&#8221;C:\\Folder2\\&#8221;<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(51, 153, 102); font-family: Courier New;\">&#8216;Tests if the file exists<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">set fso2 = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">if fso2.FileExists(pathToZipFile) = FALSE then<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">&nbsp;MsgBox &#8220;The file does not exist!&#8221;<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">&nbsp;exit sub<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">end if<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><br style=\"background-color: rgb(255, 255, 255); color: rgb(51, 153, 102); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(51, 153, 102); font-family: Courier New;\">&#8216;Tests if the folder exists<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">if fso2.FolderExists(extractTo) = FALSE then<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">&nbsp;MsgBox &#8220;The folder does not exist!&#8221;<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">&nbsp;exit sub<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">end if <\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">&nbsp;<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(51, 153, 102); font-family: Courier New;\">&#8216;Extracts the file<\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">Set SA = CreateObject(&#8220;Shell.Application&#8221;) <\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">Set filesInzip=SA.NameSpace(pathToZipFile).items <\/span><br style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\"><span style=\"background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); font-family: Courier New;\">SA.NameSpace(extractTo).CopyHere(filesInzip)<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question:Can I extract a ZIP file via scripts? Solution: Yes, you can. For example: &#8216;ZIP file to be extracted:pathToZipFile=&#8221;C:\\Folder1\\MyZIPfile.zip&#8221; &#8216;Folder of destination:extractTo=&#8221;C:\\Folder2\\&#8221;&#8216;Tests if the file existsset fso2 = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)if fso2.FileExists(pathToZipFile)&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0},"categories":[763],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Extracting ZIP files via scripts. - Elipse Knowledgebase<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Extracting ZIP files via scripts.\" \/>\n<meta property=\"og:description\" content=\"Question:Can I extract a ZIP file via scripts? Solution: Yes, you can. For example: &#8216;ZIP file to be extracted:pathToZipFile=&#8221;C:Folder1MyZIPfile.zip&#8221; &#8216;Folder of destination:extractTo=&#8221;C:Folder2&#8221;&#8216;Tests if the file existsset fso2 = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)if fso2.FileExists(pathToZipFile)&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\" \/>\n<meta property=\"og:site_name\" content=\"Elipse Knowledgebase\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/elipsesoftware\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-25T20:39:13+00:00\" \/>\n<meta name=\"author\" content=\"Elipse Software\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Elipse Software\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\"},\"author\":{\"name\":\"Elipse Software\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\"},\"headline\":\"Extracting ZIP files via scripts.\",\"datePublished\":\"2019-03-25T20:39:13+00:00\",\"dateModified\":\"2019-03-25T20:39:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\"},\"wordCount\":103,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"articleSection\":[\"Scripts\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\",\"url\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\",\"name\":\"[:pt]Extracting ZIP files via scripts.[:] - Elipse Knowledgebase\",\"isPartOf\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#website\"},\"datePublished\":\"2019-03-25T20:39:13+00:00\",\"dateModified\":\"2019-03-25T20:39:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\/\/kb.elipse.com.br\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Extracting ZIP files via scripts.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kb.elipse.com.br\/#website\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"name\":\"Elipse Knowledgebase\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kb.elipse.com.br\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kb.elipse.com.br\/#organization\",\"name\":\"Elipse Software\",\"url\":\"https:\/\/kb.elipse.com.br\/\",\"sameAs\":[\"http:\/\/www.facebook.com\/elipsesoftware\"],\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"contentUrl\":\"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png\",\"width\":161,\"height\":58,\"caption\":\"Elipse Software\"},\"image\":{\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87\",\"name\":\"Elipse Software\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g\",\"caption\":\"Elipse Software\"},\"url\":\"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Extracting ZIP files via scripts. - Elipse Knowledgebase","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/","og_locale":"en_US","og_type":"article","og_title":"[:pt]Extracting ZIP files via scripts.[:] - Elipse Knowledgebase","og_description":"Question:Can I extract a ZIP file via scripts? Solution: Yes, you can. For example: &#8216;ZIP file to be extracted:pathToZipFile=&#8221;C:Folder1MyZIPfile.zip&#8221; &#8216;Folder of destination:extractTo=&#8221;C:Folder2&#8221;&#8216;Tests if the file existsset fso2 = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)if fso2.FileExists(pathToZipFile)&hellip;","og_url":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/","og_site_name":"Elipse Knowledgebase","article_publisher":"http:\/\/www.facebook.com\/elipsesoftware","article_published_time":"2019-03-25T20:39:13+00:00","author":"Elipse Software","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Elipse Software"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#article","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/"},"author":{"name":"Elipse Software","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87"},"headline":"Extracting ZIP files via scripts.","datePublished":"2019-03-25T20:39:13+00:00","dateModified":"2019-03-25T20:39:13+00:00","mainEntityOfPage":{"@id":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/"},"wordCount":103,"commentCount":0,"publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"articleSection":["Scripts"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/","url":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/","name":"[:pt]Extracting ZIP files via scripts.[:] - Elipse Knowledgebase","isPartOf":{"@id":"https:\/\/kb.elipse.com.br\/#website"},"datePublished":"2019-03-25T20:39:13+00:00","dateModified":"2019-03-25T20:39:13+00:00","breadcrumb":{"@id":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/kb.elipse.com.br\/extracting-zip-files-via-scripts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/kb.elipse.com.br\/en\/"},{"@type":"ListItem","position":2,"name":"Extracting ZIP files via scripts."}]},{"@type":"WebSite","@id":"https:\/\/kb.elipse.com.br\/#website","url":"https:\/\/kb.elipse.com.br\/","name":"Elipse Knowledgebase","description":"","publisher":{"@id":"https:\/\/kb.elipse.com.br\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kb.elipse.com.br\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/kb.elipse.com.br\/#organization","name":"Elipse Software","url":"https:\/\/kb.elipse.com.br\/","sameAs":["http:\/\/www.facebook.com\/elipsesoftware"],"logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/","url":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","contentUrl":"https:\/\/kb.elipse.com.br\/wp-content\/uploads\/2019\/05\/schererelipse-com-br\/logoElipse.png","width":161,"height":58,"caption":"Elipse Software"},"image":{"@id":"https:\/\/kb.elipse.com.br\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/def69ea453ea60b250497b89225a9f87","name":"Elipse Software","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kb.elipse.com.br\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff1f7ec38f4687b06f6851d97b3cd2d0?s=96&d=mm&r=g","caption":"Elipse Software"},"url":"https:\/\/kb.elipse.com.br\/en\/author\/webmasterelipse-com-br\/"}]}},"_links":{"self":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2361"}],"collection":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/comments?post=2361"}],"version-history":[{"count":0,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/posts\/2361\/revisions"}],"wp:attachment":[{"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/media?parent=2361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/categories?post=2361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kb.elipse.com.br\/en\/wp-json\/wp\/v2\/tags?post=2361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}