LoginSignup
1
0

More than 5 years have passed since last update.

ファイル名と同じフォルダを作って入れるbat

Posted at

最近仕事でファイルと同じ名前のフォルダを作って、
その中にファイルを入れなおすとかいう作業があったので自動化してみました。
(拡張子込みの名前のフォルダが作成されます)


@echo off

:LOOP

if "%~1"=="" (goto EOF)

rem echo "%~1"
rem echo "%~dp1%~nx1"
rem pause 


mkdir "%~dp1%~n1"

move "%~1" "%~dp1%~n1"


echo "%~n1"
echo "%~nx1"
rename "%~n1" "%~nx1"

shift
goto LOOP

:EOF

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0