NET Use and ERROR LEVEL Issue (Batch File)
<p>So I need to map a drive, copy some files and disconnect the drive... the problem is some of the computers which we don't know which are which will have different passwords... so I am trying to use this but it doesn't seem to recognize the error for an invalid password.</p>

<p>Any help would be appreciated. </p>

<pre><code>net use Z: "\\POS1\c$\PATH" %password% /user:%username%
IF ERRORLEVEL 0 goto copy
IF ERRORLEVEL 1 goto retry1
:retry1
net use Z: "\\POS1\c$\PATH" %password2% /user:%username2%
IF ERRORLEVEL 0 goto copy
IF ERRORLEVEL 1 goto retry2
:retry2
net use Z: "\\POS1\c$\PATH" %password3% /user:%username3%
IF ERRORLEVEL 0 goto copy
IF ERRORLEVEL 1 goto POS2
:copy
xcopy /y "c:\avi\aaaaaa.ini" "Z:\"
xcopy /y "c:\avi\aaaaaa.avi" "Z:\"
net use Z:  /delete

:POS2
</code></pre>