Created
June 1, 2016 08:22
-
-
Save brake/2613978771023d2c732020c48f4e8d3f to your computer and use it in GitHub Desktop.
Create a new directory and move desired files here (like Create directory from selection in Mac Finder)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| set proceed=true | |
| if "%1"=="" set proceed=false | |
| if "%2"=="" set proceed=false | |
| if %proceed%==false ( | |
| echo. | |
| echo Create directory and move desired files to it. | |
| echo. | |
| echo Usage: | |
| echo ^<dir name^> ^<file1^> ^<file2^> ... ^<fileN^> | |
| exit /b | |
| ) | |
| echo Creating dir %1 | |
| echo. | |
| md "%~1" | |
| set destination="%~1" | |
| shift | |
| :loop | |
| if not "%~1"=="" ( | |
| echo | set /p dummy=Moving file %1 ... | |
| move "%~1" "%destination%" >nul | |
| echo Done | |
| shift | |
| goto loop | |
| ) | |
| echo. | |
| echo All done! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment