NET USE LPT1 \\Server\HPLJ4 /PERSISTENT:No IF ERRORLEVEL 1 ( ECHO Error connecting printer HP LaserJet 4 )