title: check if network drive exists and mount it otherwise check until it's available
body: <p>I need help creating a VBScript to do the following:</p>
  
  <p>Launch a service called "NAS PM service"</p>
  
  <pre><code>net start "NAS PM service"
  </code></pre>
  
  <p>then check if \192.168.1.1\drive1 exists</p>
  
  <pre><code>IF EXIST \192.168.1.1\drive1
  </code></pre>
  
  <p>If it does, map it to a drive specifying a login/pass:</p>
  
  <pre><code>net use M: \192.168.1.1\Disk_1 password /USER:admin
  </code></pre>
  
  <p>If it does not exist yet, wait 10 seconds before attempting to map it again (until success).</p>
  
  <p>I know more or less how to do this as a batch file using <code>ping</code> to wait but I'd rather use a small and clean VBScript without <code>ping</code>.</p>