1) Make a batchfile:
Open Notepad and paste the command into it.
Save the file as "FILENAME.BAT" where FILENAME is something that you can remember. Like DELDIRS, or something similar. Place the file in a directory where you can easily find it later.

When you need to run the command, either double-click on it, or use the command line to run it.

For example. To create a batchfile from the command in my last post. You would cut and pase the following into Notepad, then save it as DELDIRS.BAT:
:: -------DELDIRS.BAT--------
@ECHO OFF
FOR /F %%I IN ('DIR /AD /B C:\MyProject\TEST*') DO (RD /S /Q C:\MyProject\%%I)
:: -------DELDIRS.BAT--------

2) Use the command history:
If you have run some commands at the DOS prompt and wish to run one of those commands again, you can use the UP/DOWN-ARROW keys to scroll through your command history. When the command-line is displaying the command you need, you can either hit ENTER, or you can use the LEFT/RIGHT-ARROW keys to move through and edit the command. When you are finished editing the command, you can hit ENTER to run it again.

Make sure that you have the Command History enabled. With the command-line window open, click on the icon in the top-left corner of the window. From the menu, select "Properties". In the "Properties" window, select the "Options" tab. In the section labeled "Command History" increase your "Buffer Size" to at least "50" and your "Number of Buffers" to at least "4". When you hit the OK button at the bottom, you should be asked if you want to "Apply to current window" or "Modify the shortcut". Select "Modify the shortcut" to ensure the settings are kept for the next time.