move the files from departure to destination 0.0.9.bat

박정훈·2022년 4월 25일
0

rem 1 from Desktop to Destination
setlocal
set username=박 정 훈
set destination=sorted by extension
cd "C:\Users\%username%\Desktop"
for %%i in (.) do if not "%~nx0"=="%%~nxi" (if not exist "%%~xi\" md "%%~xi")&& move "%%i" "%%~xi"

rem 1.1
setlocal
set username=박 정 훈
set destination=sorted by extension
cd "C:\Users\%username%\Desktop"
mkdir "%destination%"

rem 1.2
setlocal
set username=박 정 훈
set destination=sorted by extension
cd "C:\Users\%username%\Desktop"
for /d %%i in (.*) do move "%%i" "%destination%"

rem 1.3
setlocal
set username=박 정 훈
set destination=sorted by extension
cd "C:\Users\%username%\Desktop"
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do ren "%destination%" "%destination% - %%i"

rem 1.4
setlocal
set username=박 정 훈
set destination=C:\Users\박 정 훈\Desktop\Destination
cd "C:\Users\%username%\Desktop"
mkdir jhptemp
for /d %%i in ("sorted by extension*") do move "%%i" "jhptemp"
move "jhptemp" "%destination%"
cd "%destination%"
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do set yyyymmddhhmm=%%i
ren "jhptemp" "%yyyymmddhhmm%"

rem 2
setlocal
set departure=C:\Users\박 정 훈\Desktop\departure
set destination=C:\Users\박 정 훈\Desktop\destination
cd "%departure%"
for /f "delims=" %%i in ('Powershell.exe get-date -Format 'yyyy MM dd HH mm'') do set yyyymmddhhmm=%%i
for /r %%i in (.) do ren "%%i" "%%~ni - %yyyymmddhhmm%%%~xi"
for /r %%i in (.) do move "%%i" "%destination%"
for /f "usebackq delims=" %%i in ("dir /s /b /ad | sort /r") do rd "%%i" 2>NUL
cd "%destination%"
for %%i in (.) do if not "%~nx0"=="%%~nxi" (
if not exist "%%~xi\" md "%%~xi"
move "%%i" "%%~xi"
)
mkdir "sorted by extension"
for /d %%i in (.*) do move "%%i" "sorted by extension"
mkdir "jhptemp"
move "sorted by extension" "jhptemp"
ren "jhptemp" "%yyyymmddhhmm%"

profile
산책과 코드가 좋아요

0개의 댓글