@echo off
rem clear any existing drive mappings
net use * /delete /y
rem map label drives
net use K: \\\\server\\apps
net use O: \\\\server\\labels
rem set time
net time \\\\server /set /yes
if not exist K: goto LogOff
rem echo "K: exists"
if not exist O: goto LogOff
rem echo "O: exists"
rem echo "Drives Mapped OK"
exit
:Logoff
rem echo "log off user"
rundll32.exe shell32.dll,SHExitWindowsEx 4
logoff works OK(the rundll line), but the NET USE command prompts the user for input if the ID/password was wrong:
The password is invalid for \\\\SERVER\\APPS. For more information, contact your network administrator.
Type the password for \\RTRON_PDC1\\APPS:
Having the user reenter their password would be fine except that the problem is they'll often forget to change the user ID, so the password would never be correct. Anybody know if there's a way to make NET USE just fail instead of prompt?