Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have written the batch program bellow and need help in redirecting the output the program puts up on screen into a log file as a permanet record.
Any help would be gratefuly appreciated thanks.@ECHO OFF
IF %3==### GOTO PError
IF NOT %3==### GOTO PError
CLS
IF NOT EXIST %1\*.* GOTO SError
CHOICE Is the backup DESTINATION a root directory
IF ERRORLEVEL 2 GOTO Standard
IF ERRORLEVEL 1 GOTO Root:Standard
IF NOT EXIST %2\*.* GOTO MakeDir
IF EXIST %2\*.* GOTO SkipMakeDir
:MakeDir
CLS
CHOICE The DESTINATION directory is invalid, do you want it created
IF ERRORLEVEL 2 GOTO DError
IF ERRORLEVEL 1 GOTO Continue
:Continue
CLS
MD %2
XCOPY %1 %2\%1 /E/I/F/-Y
IF ERRORLEVEL 4 GOTO DError
GOTO Complete
:SkipMakeDir
CLS
XCOPY %1 %2\%1 /E/I/F/-Y
IF ERRORLEVEL 4 GOTO DError
GOTO Complete:Root
CLS
XCOPY %1 %2%1 /E/I/F/-Y
IF ERRORLEVEL 4 GOTO DError
GOTO Complete:PError
ECHO *******************************************************************
ECHO * Too many Perameters,use only two i.e.Backup[Source Destination] *
ECHO *******************************************************************
GOTO END:SError
ECHO *************************************************
ECHO * Invalid Source Dirctory Please Restart Backup *
ECHO *************************************************
GOTO END:DError
ECHO *******************************************************
ECHO * Invalid Destination Directory Please Restart Backup *
ECHO *******************************************************
GOTO END:complete
ECHO *******************
ECHO * Backup Complete *
ECHO *******************:END

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |