{"id":12757,"date":"2021-12-10T05:45:41","date_gmt":"2021-12-10T05:45:41","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=12757"},"modified":"2021-12-10T05:46:11","modified_gmt":"2021-12-10T05:46:11","slug":"batch-script-to-delete-files-in-ftp","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/batch-script-to-delete-files-in-ftp\/22727.html","title":{"rendered":"Batch Script To Delete Files In FTP"},"content":{"rendered":"<p>Hi,<\/p>\n<p>&#8211; I need to write a batch script to delete the files in FTP location \/test\/plus.<br \/>\n&#8211; I used the following script.<\/p>\n<p>Delete.bat<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nE:<br \/>\ncd E:\\ABC<br \/>\n@ftp -i -s:&#8221;%~f0&#8243;&amp;GOTO;:EOF<br \/>\nopen XYZ<br \/>\nuser<br \/>\npassword<br \/>\ncd \/test\/plus<br \/>\ndelete *.zip<br \/>\ndisconnect<br \/>\nbye<\/p>\n<p>&#8211; But it deletes the *.zip files in local folder E:\\ABC.<\/p>\n<p>Please help with this as i&#8217;m new to scripts.<\/p>\n<p>Note: Instead of &#8216;delete&#8217; command i used &#8216;mget&#8217; and it worked fine. All the *.zip files are uploaded to my local folder from FTP.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":21},"question-category":[55],"question_tags":[],"class_list":["post-12757","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\/12757","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=12757"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=12757"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=12757"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=12757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}