{"id":6423,"date":"2021-11-19T07:37:08","date_gmt":"2021-11-19T07:37:08","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=6423"},"modified":"2021-11-19T07:37:35","modified_gmt":"2021-11-19T07:37:35","slug":"batch-script-copy-files-ftp-server-check-if-exists-then-skip","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/batch-script-copy-files-ftp-server-check-if-exists-then-skip\/28253.html","title":{"rendered":"Batch Script Copy Files FTP Server Check If Exists Then Skip"},"content":{"rendered":"<p>batch script, I am creating a batch script and am a little confused, I need the script to copy files from my local folder to ftp server, check if any of the files we are copying to already exists in the ftp server, if it does then copy only the files that do not exist on server<\/p>\n<p>I so far have the following which takes the files and copys to server but need help with the later part<\/p>\n<p>@Echo off<br \/>\nSet _FTPServerName=xx.xx.x.xxx<br \/>\nSet _UserName=test<br \/>\nSet _Password=test<br \/>\nSet _LocalFolder=C:\\Users\\charlie\\Documents<br \/>\nSet _RemoteFolder=ITEMS<br \/>\nSet _Filename=*.txt<br \/>\nSet _ScriptFile=ftp1<br \/>\n:: Create script<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo open %_FTPServerName%<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo %_UserName%<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo %_Password%<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo lcd %_LocalFolder%<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo cd %_RemoteFolder%<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo binary<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo prompt<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo mput %_Filename%<br \/>\n&gt;&gt;&#8221;%_ScriptFile%&#8221; Echo disconnect<br \/>\n:: Run script<br \/>\nftp -s:&#8221;%_ScriptFile%&#8221;<br \/>\nDel &#8220;%_ScriptFile%<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":3},"question-category":[55],"question_tags":[],"class_list":["post-6423","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\/6423","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=6423"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=6423"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=6423"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=6423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}