local back up 0.0.2.bat

박정훈·2022년 4월 20일
0

setlocal
set n=MPT CBT SRS
set x=.docx
mkdir "%cd%\"Recycle bin"">nul 2>&1 & pushd "%cd%\"Recycle bin""
copy /y "..\%n%%x%" .
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do ren "%n%%x%" "%n% - %%i%x%"
popd
endlocal

setlocal
set n=MTD AVD SRS
set x=.docx
mkdir "%cd%\"Recycle bin"">nul 2>&1 & pushd "%cd%\"Recycle bin""
copy /y "..\%n%%x%" .
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do ren "%n%%x%" "%n% - %%i%x%"
popd
endlocal

setlocal
set n=MTD CDD
set x=.docx
mkdir "%cd%\"Recycle bin"">nul 2>&1 & pushd "%cd%\"Recycle bin""
copy /y "..\%n%%x%" .
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do ren "%n%%x%" "%n% - %%i%x%"
popd
endlocal

timeout /t 2

rem get date and time by using powershell command and rename destination folder as "destination - yyyy mm dd hh mm"
setlocal
set n="back_up"
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do ren "%n%" "%n% - %%i"

profile
산책과 코드가 좋아요

0개의 댓글