Computer and IT knowledge - things to know
a batch script, that you can use with robocopy:
set /P answer="Are you ready for the backup? (Y/N) "
if /I "%answer%"=="Y" (
robocopy %source_directory% %destination_directory% /MIR /R:3 /W:10 /IF
if %errorlevel% neq 0 (
msg * "Robocopy sync failed! Please check the log file for details."
exit /b %errorlevel%
msg * "Robocopy sync completed successfully!"
) else (
msg * "Backup process cancelled."
another example, with an UNC target directory:
robocopy C:\source_folder \\servername\shared_folder /MIR /USER:username /PASSWORD:password
/IF option can be used, if you only want to copy if the destination directory exists!
computer2know :: thank you for your visit :: have a nice day :: © 2023