title: How to list the names of all the files and directories in a folder using for loop in a batch file
body: <p>I want to list all the files and directories inside a directory using a for loop in a batch script. How can I do it?</p>
  <p>I used below but it didn't work :</p>
  <p><code>for /r  %%I in (&quot;.&quot;) do ( ls -ltr  '%%I')   ## Listing only filenames and not directories name</code></p>
  <p>Any help is appreciable.</p>
  <p>Thanks!</p>