Enjoy.
-Hemlok
Code: Select all
:::::::::::::::::::::::::::::::::::
:: USB Backup With Voice V1.0 :
:: :
:: :
:: :
:::::::::::::::::::::::::::::::::::
@Echo off
color 0f
Title USB Backup V1.0
:: variables
set drive=G:\Backup\Flash Drive <--------***Change to your path***
set backupcmd=xcopy /s /c /d /e /h /i /r /y
::Time and date
set "CURRDATE=%DATE%" & set "CURRTIME=%TIME%"
set "HOUR=%CURRTIME:~,2%"
if "%CURRTIME:~-2%" == "PM" if %HOUR% lss 12 set /A "HOUR+=12"
if "%CURRTIME:~-2%" == "AM" if %HOUR% equ 12 set /A "HOUR-=12"
if not "%CURRDATE%" == "%DATE%" if %CURRTIME:~0,2% equ 0 set "CURRDATE=%DATE%"
set "HOUR=0%HOUR%"
@echo off
color 0a
set "spk=Hello Administrator! Todays date is %DATE%. Starting USB backup now. I will notify you when the backup has completed.."
call :speak spk
:begin
set "spk="
set /p "spk=Speak: "
if not defined spk exit
set "spk=%spk:"=%"
call :speak spk
goto begin
:speak
setlocal enableDelayedExpansion
mshta "javascript:new ActiveXObject("SAPI.SpVoice").Speak('!%~1!');close();"
endlocal
cls
echo ### Backing up Flash Drive...
set hour=%time:~0,2%
if "%hour:~0,1%"==" " set hour=0%time:~1,1%
set folder=%date:~10,4%_%date:~4,2%_%date:~7,2%_%hour%_%time:~3,2%
%backupcmd% "H:\" "G:\Backups\Flash Drive\%folder%" <--------***Change to your path***
endlocal
cls
@echo off
color 0a
set "spk=The backup process is complete! Press any key to exit."
call :speak spk
:begin
set "spk="
set /p "spk=Speak: "
if not defined spk exit
set "spk=%spk:"=%"
call :speak spk
goto begin
:speak
setlocal enableDelayedExpansion
mshta "javascript:new ActiveXObject("SAPI.SpVoice").Speak('!%~1!');close();"
endlocal
cls
@pause
exit