@echo off
rem 此脚本于2019.8.15开发
rem 用于备份桌面和我的文档里所有的.xls .xlsx .txt等文件
title 文件备份工具 By_chk141
mode con cols=100 lines=30
color 0E
rem 创建定时程序
echo wscript.sleep 500>C:\\Users\sleep.vbs
rem 创建颜色
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
mkdir D:\$MyBackup
mkdir D:\$MyBackup\xls
mkdir D:\$MyBackup\xlsx
mkdir D:\$MyBackup\txt
mkdir D:\$MyBackup\doc
mkdir D:\$MyBackup\docx
mkdir D:\$MyBackup\jpg
mkdir D:\$MyBackup\png
mkdir D:\$MyBackup\ppt
attrib +s +a +h +r "D:\$MyBackup"
attrib +s +a +h +r "D:\$MyBackup\xls"
attrib +s +a +h +r "D:\$MyBackup\xlsx"
attrib +s +a +h +r "D:\$MyBackup\txt"
attrib +s +a +h +r "D:\$MyBackup\doc"
attrib +s +a +h +r "D:\$MyBackup\docx"
attrib +s +a +h +r "D:\$MyBackup\jpg"
attrib +s +a +h +r "D:\$MyBackup\png"
attrib +s +a +h +r "D:\$MyBackup\ppt"
attrib +s +a +h +r "D:\$MyBackup\directory"
cls
echo.
echo.
echo.
echo. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo. +++ +++
echo. +++ 一键备份工具 +++
echo. +++ +++
echo. +++ 2019.08.25开发 +++
echo. +++ +++
echo. +++ 过程需要2分钟左右 +++
echo. +++ +++
echo. +++ 请耐心等待 +++
echo. +++ +++
echo. +++ 请复制当前文件到桌面目录运行 +++
echo. +++ +++
echo. +++ 或者按提示操作 +++
echo. +++ +++
echo. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
echo.
echo.
echo.
set a=※-→准备创建备份文件夹
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:0C .* "%2*" 2>nul
DEL %a% /a/f/q
echo.
echo.
wscript C:\Users\sleep.vbs
set a=※-→正在创建备份文件夹
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:0E .* "%2*" 2>nul
DEL %a% /a/f/q
echo.
echo.
wscript C:\Users\sleep.vbs
set a=※-→创建备份文件夹成功
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:0A .* "%2*" 2>nul
DEL %a% /a/f/q
echo.
echo.
wscript C:\Users\sleep.vbs
set a=※-→请输入用户名(默认请回车_默认用户名Administrator)
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:0A .* "%2*" 2>nul
DEL %a% /a/f/q
set /p username=
if %username%==NULL (
%username%=Administrator
)
cd C:/Users/%username%/Desktop
wscript C:\Users\sleep.vbs
set a=※-→开始备份(大约需要10分钟)
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:0A .* "%2*" 2>nul
DEL %a% /a/f/q
echo.
wscript C:\Users\sleep.vbs
for /r "C:/Users/%username%/Desktop" %%a in (*.txt) do (
copy %%~dpa%%~nxa D:\$MyBackup\txt
)
for /r "C:/Users/%username%/Desktop" %%a in (*.xls) do (
copy %%~dpa%%~nxa D:\$MyBackup\xls
)
for /r "C:/Users/%username%/Desktop" %%a in (*.xlsx) do (
copy %%~dpa%%~nxa D:\$MyBackup\xlsx
)
for /r "C:/Users/%username%/Desktop" %%a in (*.doc) do (
copy %%~dpa%%~nxa D:\$MyBackup\doc
)
for /r "C:/Users/%username%/Desktop" %%a in (*.docx) do (
copy %%~dpa%%~nxa D:\$MyBackup\docx
)
for /r "C:/Users/%username%/Desktop" %%a in (*.jpg) do (
copy %%~dpa%%~nxa D:\$MyBackup\jpg
)
for /r "C:/Users/%username%/Desktop" %%a in (*.png) do (
copy %%~dpa%%~nxa D:\$MyBackup\png
)
for /r "C:/Users/%username%/Desktop" %%a in (*.ppt) do (
copy %%~dpa%%~nxa D:\$MyBackup\ppt
)
wscript C:\Users\sleep.vbs
cls
color a
echo.
echo.
echo.
echo.
echo. OOOOOOOOO KKKKKKKKK KKKKKKK
echo. OO:::::::::OO K:::::::K K:::::K
echo. OO:::::::::::::OO K:::::::K K:::::K
echo. O:::::::OOO:::::::O K:::::::K K::::::K
echo. O::::::O O::::::O KK::::::K K:::::KKK
echo. O:::::O O:::::O K:::::K K:::::K
echo. O:::::O O:::::O K::::::K:::::K
echo. O:::::O O:::::O K:::::::::::K
echo. O:::::O O:::::O K:::::::::::K
echo. O:::::O O:::::O K::::::K:::::K
echo. O:::::O O:::::O K:::::K K:::::K
echo. O::::::O O::::::O KK::::::K K:::::KKK
echo. O:::::::OOO:::::::O K:::::::K K::::::K
echo. OO:::::::::::::OO K:::::::K K:::::K
echo. OO:::::::::OO K:::::::K K:::::K
echo. OOOOOOOOO KKKKKKKKK KKKKKKK
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
wscript C:\Users\sleep.vbs
set a=※-→备份完成3秒后自动退出
call :zc 1 %%a%%
goto :cz
:cz
pause>nul
goto :eof
:zc
for /l %%i in (1,1,%1) do set /p= <nul>%2&findstr /a:0A .* "%2*" 2>nul
DEL %a% /a/f/q
echo.
echo wscript.sleep 3000>C:\\Users\sleep.vbs
wscript C:\Users\sleep.vbs
exit
@pause>nul