organize desktop 0.0.4.bat

박정훈·2022년 4월 20일
0

rem 1.3 enter desktop, here
setlocal
set username=jhp01
set destination=sorted by extension
cd "C:\Users\%username%\Desktop"

rem 1.4 orgnize files in desktop, move them into folders that named including extension, here
setlocal
set username=jhp01
set destination=sorted by extension
for %%i in (.) do if not "%~nx0"=="%%~nxi" (
if not exist "%%~xi\" md "%%~xi"
move "%%i" "%%~xi"
)

rem 1.5 make destination folder, here
setlocal
set username=jhp01
set destination=sorted by extension
mkdir "%destination%"

rem 1.6 move folders named including extension into destination folder, here
setlocal
set username=jhp01
set destination=sorted by extension
for /d %%i in (.*) do move "%%i" "%destination%"

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

profile
산책과 코드가 좋아요

0개의 댓글