@echo off rem --------------------------------------------------------------- rem medlibraryprinter.bat: Connect to Library Printer \\cwmlpsrv\inforoom rem %1 is user's NetID rem --------------------------------------------------------------- echo Connect to Library Printer \\cwmlpsrv\inforoom if "%1" == "" goto usage echo When prompted for the password for \\cwmlpsrv\inforoom, echo enter your NetID password net use lpt3: \\cwmlpsrv\inforoom * /user:yale\%1 if errorlevel 1 goto try2 goto success :try2 net use lpt3: \\cwmlpsrv\inforoom * /user:yale\%1 if errorlevel 1 goto try3 goto success :try3 net use lpt3: \\cwmlpsrv\inforoom * /user:yale\%1 if errorlevel 1 goto failed goto success :success echo Connection Successful: net use goto end :failed echo The Printer failed to connect. echo Try again later. goto:end :usage echo Usage: medlibraryprinter NetID LPT# goto end :end pause