• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Need an automated way to create folders from filenames

Status
Not open for further replies.

Kelemvor

Lifer
So I have a bunch of files in one folder. I want to move each file into a folder that matches the name of the file. I can do this through DOS but am having trouble when the filename has a space in it.

E.g. c:\this is the file.txt -> c:\this is the file\this is the file.txt

Can anyone help me out with this?

Here's the DOS command that works as long as there aren't any spaces...

for /f %f in ('dir *.txt /b') do md %~nf & move %f .\%~nf\

Thanks.
 
Status
Not open for further replies.
Back
Top