title: Batch script using 7 zip
body: <p>I have the below folder structure, I want to zip all the files and folders within the folder. </p>
  
  <pre><code>Master Directory
  File 1
  File 2
  
  SubFolder1
  ABC Folder
  file 1
  XYZ Folder
  file 1
  </code></pre>
  
  <p>And I'm using the below code, when I run it I am able to <strong>zip</strong> sub folders in the master directory and their sub folder and files. But not able to zip files inside the master directory.</p>
  
  <pre><code>CD /d D:\reports
  for /d %%X in (*) do "C:\Program Files\7-Zip\7z.exe" a  "D:\Report.zip" "%%X"
  </code></pre>
  
  <p>How to zip all the contents in the master folder. Any help will be appreciated.</p>