1.

Solve : Read file name create folder and move file to folder.?

Answer»

I want the batch file to delete it's after wards.
I havent figured out how to make it do a sub folder work either.
Any ideas?
THANKS

Here is a copy

@echo off
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)This seems to work:

Code: [Select]@echo off
for %%a in (*.*) do (
if %%~a NEQ %0 (
md "%%~na" 2>nul
move "%%a" "%%~na\"
)
)Quote from: twinkie on October 21, 2012, 12:05:09 PM

I want the batch file to delete it's SELF after the job is completed.
I haven't figured out how to make it copy sub folder work either.
Any ideas?
Thanks

Here is a copy

@echo off
for %%a in (*.*) do (
md "%%~na" 2>nul
move "%%a" "%%~na"
)
At the end of the batch file add:

Code: [Select]del "%~F0" 2>nul
See if that works to delete the batch file.


Don't be a prat and play tricks on someone with it though - otherwise Satan will hunt you down and play the bongos on your balls.Nothing foolish... To old for that crap...
Thank you!


Discussion

No Comment Found