SET a = 0 @ECHO OFF ECHO __________________________________________________ >> C:\Mounting.txt ECHO Trying to mount forms to F:\ drive: %date% %time% >> C:\Mounting.txt net use F: \\grfs01\groupdirs$\forms ECHO Error level: %errorlevel% %date% %time% >> C:\Mounting.txt if ERRORLEVEL 0 (GOTO :exit) ELSE ( GOTO retry ) :retry set /a a +=1 if %a == 6 (GOTO error) ECHO Error: %date% %time% >> C:\Mounting.txt ECHO Dismounting volume: %date% %time% >> C:\Mounting.txt net use F: /Delete ECHO Remounting volume: %date% %time% >> C:\Mounting.txt net use F: \\grfs01\groupdirs$\forms ECHO Error level: %errorlevel% >> C:\Mounting.txt IF errorlevel 0 (GOTO :exit) ELSE (GOTO retry) :exit ECHO Forms folder sucessfully mounted: %date% %time% >> C:\Mounting.txt exit ::error ECHO Unknown error: %data %time% >> C:\Mounting.txt exit
Some output:
_______________________________________________________________ Trying to mount forms to F:\ drive: Wed 09/01/2010 11:29:37.04 Error level: 0 Wed 09/01/2010 11:29:37.08 Forms folder sucessfully mounted: Wed 09/01/2010 11:29:37.10 _______________________________________________________________ Trying to mount forms to F:\ drive: Wed 09/01/2010 11:29:45.60 Error level: 2 Wed 09/01/2010 11:29:45.66 Forms folder sucessfully mounted: Wed 09/01/2010 11:29:45.66
This post has been edited by redhotfire0: 01 September 2010 - 08:31 AM

New Topic/Question
Reply




MultiQuote



|