;Initialize variables Local $Username, $Password, $Result, $Flag $Flag = 0 RunWait("cmd /c net use w: /DELETE") RunWait("cmd /c net use p: /DELETE") Do if $Flag = 1 Then MsgBox(0,"Error","Your username or password were incorrect. Please try again") EndIf $Flag = 1 $Username = InputBox("Logon to Network Drives", "Please enter your username:","","",150,80) if $Username = "" then Exit endif $Password = InputBox ("Logon to Network Drives", "Please enter your password:","","!",150,80) if $Password = "" then Exit endif $Result = RunWait("cmd /c net use w: \\server\homes " & $Password & " /USER:" & $Username & " /PERSISTENT:NO") $Result = RunWait("cmd /c net use p: \\server\public " & $Password & " /USER:" & $Username & " /PERSISTENT:NO") Until $Result = 0 AND NOT @error Exit