3

I was able to do this in Linux, but Windows batch script is a lot different, hope someone can help me. I have a folder with a couple 100 files. I want a batch script that creates a folder for each of these files with the same name, but without the extension (eg: sheet1.xls will create a folder named sheet1).

After that each file should to moved to its corresponding folder (eg: sheet1.xls -> create folder sheet1 -> move the xls file to sheet1 folder).

Can anyone help me out with this?

4

1 回答 1

3
for %%a in (C:\folder\*.*) do (
md "%%~pna"
move "%%a" "%%~pna"
)
于 2012-11-13T10:29:28.720 回答