title: Problems with batch script zip file to ftp
body: <p>I am having problems with a batch script that should zip some pdf files and upload them to a FTP server.</p>
  
  <p>My script looks like this:</p>
  
  <pre><code>@echo off
  
  set d=%date:~0,2%%date:~3,2%%date:~6,4%
  set d=%d: =_%
  set t=%time:~0,2%%time:~3,2%%time:~6,2%
  set t=%t: =0%
  
  set file="C:\Program Files (x86)\7-Zip\7z.exe" a -r 46730_%d%_%t%.zip *.pdf
  
  
  echo open my.host.name&gt;&gt; temp
  echo myusername&gt;&gt; temp
  echo mypassword&gt;&gt; temp
  echo ascii&gt;&gt; temp
  echo cd /
  echo binary
  echo put %file%&gt;&gt; temp
  echo close&gt;&gt; temp
  echo quit&gt;&gt; temp
  
  ftp -s:temp
  
  del temp
  
  TIMEOUT /T 5
  </code></pre>
  
  <p>The zip files is created OK with the correct name, and I am able to open it afterwards. I'm pretty sure the problem(s) lies in the upload part of the script, but I can't find any working solution on google :-( The reciever is not able to open the zip file. He gets this error: Could'nt open the file as an archieve.</p>
  
  <p>What am I doing wrong ??</p>