title: Network drive after restart disconnect
body: <p>I need advice.
  I run a script on my computer that copies the files to the network drive. Periodically, it turns on via the task scheduler.
  But it happens that after a reboot the network drive does not connect - even though when I set it up I checked &quot;reconnect at login&quot;. (Usually I just double-click on the drive and it reconnects). But if I don't do this, the script can't put it anywhere because the disk doesn't seem to be there.</p>
  <p><a href="https://i.stack.imgur.com/K0WFb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K0WFb.png" alt="enter image description here" /></a></p>
  <p>I tried:</p>
  <ul>
  <li><p>turning off fast booting,</p>
  </li>
  <li><p>put a batch file in the folder after boot:</p>
  <pre><code>@echo Create new Y: drive mapping
    net use Y: \\server\folder
    :exit
  </code></pre>
  </li>
  <li><p>put another batch file in the &quot;after boot&quot; folder</p>
  <pre><code>  @echo off
  
    :Start
    timeout /t 5 /nobreak &gt;NUL
    if exist Y:\NUL goto End
    net use Y: \\server\folder /USER:domain\user password /PERSISTENT:YES
    if ERRORLEVEL 1 goto Start
    :End
  </code></pre>
  </li>
  </ul>
  <p>But neither solved the problem.</p>