I'm trying to create a .bat file that will make dir #-z and then load *#-*z into there respective folders, it basically looked like this but didn't work correctly mkdir a mkdir b mkdir c etc... move *a a move *b b move *c c etc... what is going wrong?
Hello and Welcome to MDL! Can't really tell what's wrong if we don't have the actual script you are trying to run / error messages etc etc Just a guess, but maybe it could be the syntax that's wrong. Its very easy to make mistake(s) whilst writing such scripts. If that's the case - not to worry - there are endless resources on the topic. Take a look here, here and here ... You should be able to work it out
As stated above, we need an actual script. Since you admit to not knowing how to do it you are not in a position to decide what information you can fail to give in order to receive a working solution. Provide a real directory structure with real file names, you are not moving items ending with a, b or c into directories named a, b or c, especially because those directories match your move specification. (you cannot move a directory named *a into directory a because they are one and the same thing).
Try this @echo off SET dsk=%userprofile%\Desktop cd %dsk% set TD="%dsk%\Desktop Clearout\From %DATE%" if not exist "%TD%\nul" Mkdir %TD% setlocal ENABLEDELAYEDEXPANSION FOR %%f IN (*.*) DO ( set t=%%f if not exist "%TD%\!t:~-3!\nul" Mkdir %TD%\!t:~-3! move "!t!" %TD%\!t:~-3! ) It'll create a "Desktop Clearout" folder on your desktop and remove files on the desktop to it and organise them according to type. I'm guessing it's something like this you're looking for. Very useful if (like me) you habitually clutter your desktop with all kinds of rubbish you can't be bothered to sort ot just now.