0

i have just begun a computer science class at my college and have no experiance with command prompt. I need help to: "4. Create a batch file called makefiles.bat that will traverse all the folders and redirect the output of the cd command to a file within that folder. The file name should be foldername.txt where foldername is replaced by the letter of that folder. The last line of the batch file should show tree/f."

I don't need a specific anwser as i want to learn on my own as well, but id like some guidlines as to where to start as i have no idea what commands to utilize here. Thanks in advance.

Nick Vez
  • 9
  • 1
  • 2
    For general help. Type `Help` in the command prompt. For each command listed type `help ` (eg `help dir`) or ` /?` (eg `dir /?`). See my answer here http://stackoverflow.com/questions/31820569/trouble-with-renaming-folders-and-sub-folders-using-batch for a summary of other command prompt grammar (such as redirection). To see all help try this compound command `for /f %A in ('Help') do %A /?`. Press Ctrl + C (exit a console program without exiting the console) when bored. You can configure the console by right clicking the titlebar and choosing Properties. –  Sep 28 '16 at 02:56
  • Type `doskey /?` for a list of editing keys at the command prompt. –  Sep 28 '16 at 02:59
  • A good site to start is [ss64.com](http://ss64.com/nt/syntax.html) and it's [overview](http://ss64.com/nt/) of all commands. – Stephan Sep 28 '16 at 05:39

1 Answers1

1

Look at dir specifically: dir /s /b /AD. This lists the directories.

Look also at for /f which can be used to loop over the output of the above command

Redirection to a file can be done with the > character.

That should be your major building blocks. Good luck

FloatingKiwi
  • 4,408
  • 1
  • 17
  • 41