Hey guys...
How do you suppress error messages in a DOS file that runs in Win2000/XP?
This is a file to be clicked on by external reps to connect shared folders to their computer...
@ECHO OFF
REM ___Company Share Directory_____
ECHO.
ECHO.
ECHO.
ECHO --Connecting Company Share Directory--
NET USE T: \\SERVER_NAME_REMOVED\CompanyShare
If NOT errorlevel 1 GOTO next
ECHO.
ECHO *** An error occured during Connection to Company Share Directory ***
ECHO Drive not connected
REM ___Sales Directory______
:next
ECHO.
ECHO.
ECHO.
ECHO --Connecting Sales Directory--
NET USE S: \\SERVER_NAME_REMOVED\Sales
If NOT errorlevel 1 GOTO last
ECHO.
ECHO *** An error occured during Connection to Sales Directory ***
ECHO Drive not connected
REM ___Keep Window Open to View Results________
:last
ping -n 5 localhost >nul
Should the connection fail, I'd like it to say the error message I have created, not Error 53, Connection not found, or whatever.
I tried using CTTY NUL and adding >CON to all echo's, but CTTY has been removed.
Any thoughts or suggestions?
How do you suppress error messages in a DOS file that runs in Win2000/XP?
This is a file to be clicked on by external reps to connect shared folders to their computer...
@ECHO OFF
REM ___Company Share Directory_____
ECHO.
ECHO.
ECHO.
ECHO --Connecting Company Share Directory--
NET USE T: \\SERVER_NAME_REMOVED\CompanyShare
If NOT errorlevel 1 GOTO next
ECHO.
ECHO *** An error occured during Connection to Company Share Directory ***
ECHO Drive not connected
REM ___Sales Directory______
:next
ECHO.
ECHO.
ECHO.
ECHO --Connecting Sales Directory--
NET USE S: \\SERVER_NAME_REMOVED\Sales
If NOT errorlevel 1 GOTO last
ECHO.
ECHO *** An error occured during Connection to Sales Directory ***
ECHO Drive not connected
REM ___Keep Window Open to View Results________
:last
ping -n 5 localhost >nul
Should the connection fail, I'd like it to say the error message I have created, not Error 53, Connection not found, or whatever.
I tried using CTTY NUL and adding >CON to all echo's, but CTTY has been removed.
Any thoughts or suggestions?