{"id":14616,"date":"2021-12-15T11:57:44","date_gmt":"2021-12-15T11:57:44","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=14616"},"modified":"2021-12-15T12:00:29","modified_gmt":"2021-12-15T12:00:29","slug":"batch-file-to-download-from-ftp-by-file-type","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/batch-file-to-download-from-ftp-by-file-type\/20892.html","title":{"rendered":"Batch File To Download From Ftp By File Type"},"content":{"rendered":"<p>HI,<\/p>\n<p>I am trying to make a batch file that downloads all files from my ftp server not by there filename but by there file type. The file type I need it to download is .occ and .ord<\/p>\n<p>This is the code I have that can download from ftp by a filename:<\/p>\n<p>::&#8212;Start download.cmd&#8212;<br \/>\n@echo off<br \/>\nsetlocal<\/p>\n<p>::Variables<br \/>\nset f=%temp%\\ftpc.txt<\/p>\n<p>::Compose ftp commands file<br \/>\necho open HOST&gt;&gt;%f%<br \/>\necho user USER PWD&gt;&gt;%f%<br \/>\necho binary&gt;&gt;%f%<br \/>\necho cd \/htdocs\/acatalog&gt;&gt;%f%<br \/>\necho get FILENAME&gt;&gt;%f%<br \/>\necho bye&gt;&gt;%f%<\/p>\n<p>::Execute ftp command<br \/>\n::Use &#8220;-d&#8221; key for verbose output<br \/>\nftp -n -d -s:%f%<\/p>\n<p>::Cleanup<br \/>\ndel \/f \/q %f%<br \/>\nendlocal<br \/>\n::&#8212;End download.cmd&#8212;<\/p>\n<p>also while I am posting on here, Does anyone know of a way to change file permissions on my server through a batch file.<\/p>\n<p>Simon<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":17},"question-category":[55],"question_tags":[],"class_list":["post-14616","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/14616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=14616"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=14616"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=14616"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=14616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}