I have a variety of "files" (not folders) of the same type (e.g. "
.docx"), in the same directory.
Also, in that SAME directory, I have a sub-directory named "
catalog", and within it, alphabetical folders (i.e, starting with
F, and so on...).
Assuming these files are located at "
D:/documents/", how [Using Windows CMD, or Windows Powershell] would I sort through the list of files, and move them into the "catalog" folder, into their proper [case-sensitive] "Alphabetical" folder, sorting by the [case-insensitive] first letter of their file-name?
For example: [
D:/documents/janet_henderson.docx] would move to [
Please note I need to have files with names starting with any number go into the "
What I have so far
I have the following in a
move documents\A*.docx documents\catalog\A\ move documents\B*.docx documents\catalog\B\ move documents\C*.docx documents\catalog\C\ move documents\D*.docx documents\catalog\D\ move documents\E*.docx documents\catalog\E\ move documents\F*.docx documents\catalog\F\ move documents\G*.docx documents\catalog\G\ move documents\H*.docx documents\catalog\H\ move documents\I*.docx documents\catalog\I\ move documents\J*.docx documents\catalog\J\ move documents\K*.docx documents\catalog\K\ move documents\L*.docx documents\catalog\L\ move documents\M*.docx documents\catalog\M\ move documents\N*.docx documents\catalog\N\ move documents\O*.docx documents\catalog\O\ move documents\P*.docx documents\catalog\P\ move documents\Q*.docx documents\catalog\Q\ move documents\R*.docx documents\catalog\R\ move documents\S*.docx documents\catalog\S\ move documents\T*.docx documents\catalog\T\ move documents\U*.docx documents\catalog\U\ move documents\V*.docx documents\catalog\V\ move documents\W*.docx documents\catalog\W\ move documents\X*.docx documents\catalog\X\ move documents\Y*.docx documents\catalog\Y\ move documents\Z*.docx documents\catalog\Z\
- Is there a better way to complete this operation such as putting it in a loop maybe?
- How do I take care of the files starting with a number, though?
- Do I need to tell Windows CMD to be case-insensitive, when checking for the file names?