Search This Blog

Wednesday, November 22, 2017

Neatest DOS Trick I've Ever Seen

I don't consider myself a DOS expert by any stretch of the imagination. I smile when I tell people I know enough to be dangerous and when I discover something cool - like when I learned that typing "cmd" in the address bar of Windows Explorer will open a DOS window to that specific directory - I smile and feel giddy. I experimented with this command last night:

dir b:\*.* /s /b, g:\*.* /s /b>g:\2017_11_22_allofB_allofG_fp.txt

I learned that it will create a single file with a full path list of all of the files on the b:\ drive AND all of the files on the g:\ drive. What is so AWESOME is that it ought to make consolidating files so much easier. Yes, I have been using commands like this one for many years:

dir b:\*.* /s /b>b:\2017_11_22_allofB_allofB_fp.txt
dir g:\*.* /s /b>b:\2017_11_22_allofG_allofB_fp.txt

but if I wanted to have a single file with what is created with the first command, I would have to manually combine the two files:

b:\2017_11_22_allofB_allofB_fp.txt
and
b:\2017_11_22_allofB_allofB_fp.txt
to get what I wanted. Now, one command does it!

No comments: