title: SMBJ: How to print all the files present in a particular subfolder
body: <p>I am facing issue with printing all the file belonging to a particular sub folder in windows VM.</p>
  <h1>Overview:</h1>
  <p>I have got a windows VM whose IP address is <strong>10.162.12.12</strong></p>
  <p>I want to print all the files name present under <strong>C:\MyFolder\MySubFolder</strong></p>
  <p>Currently 'MySubFolder' contains 4 cmd files i.e. <strong>a.cmd, b.cmd, c.cmd, d.cmd</strong></p>
  <pre><code> try (Connection connection = client.connect(&quot;10.162.x.x&quot;)) {
  
          AuthenticationContext ac = new AuthenticationContext(&quot;userName&quot;, &quot;pwd&quot;.toCharArray(), &quot;domainName&quot;);
          Session session = connection.authenticate(ac);
  
          // Connect to Share
          try (DiskShare share = (DiskShare) session.connectShare(&quot;MyFolder&quot;)) {
              for (FileIdBothDirectoryInformation f : share.list(&quot;/MySubFolder&quot;)) {
                  System.out.println(&quot;File : &quot; + f.getFileName());
              }
          } catch (Exception e) {
              e.printStackTrace();
          }
  </code></pre>
  <p>I am not sure how to pass my &quot;C&quot; drive information and path i.e. where to pass the path.Currently I am getting the following error:</p>
  <blockquote>
  <p>15:48:17.991 INFO  c.h.smbj.connection.Connection - Successfully connected to: 10.162.12.12
  15:48:18.826 INFO  c.h.smbj.connection.Connection - Successfully authenticated userName on 10.162.12.12, session is 140737488355349
  15:48:18.826 INFO  com.hierynomus.smbj.session.Session - Connecting to \10.162.12.12\MyFolder on session 140737488355349
  15:48:19.357 INFO  com.hierynomus.smbj.session.Session - Logging off session 140737488355349 from host 10.162.12.12
  com.hierynomus.mssmb2.SMBApiException: STATUS_BAD_NETWORK_NAME (0xc00000cc): Could not connect to 10.162.12.12\MyFolder
  at com.hierynomus.smbj.session.Session.connectTree(Session.java:173)
  at com.hierynomus.smbj.session.Session.connectShare(Session.java:144)
  at com.olf.agon.smbj.SMBFile3Trail.main(SMBFile3Trail.java:36)<code>    </code></p>
  </blockquote>
  <p>All i want to know how should I pass the value to my connectionShare() method and to the list() method so that I am able to connect to &quot;\10.162.12.12\C\MyFolder&quot;.</p>