I have a directory with a bunch of folders and I want to create a text file for each folder containing this string: Visit http://www.example.com. How can I do this with windows cmd?
closed as not constructive by John Gardeniers, Dave M, Khaled, Alex, Antoine Benkemoun Feb 5 at 17:26
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.
This is actually fairly simple to do given a short string like that:
%M stands in for the directories being iterated over.
(e:\somdir*) is the path to be iterated over.
Everything after the
Afaik, simple cmd does not provide the same power as bash or power shell. The most easiest way working on severall platforms is by using a macro-like language, looping through the directories and put the textfile. I suggest to use AutoIT - http://www.autoitscript.com/site/autoit/
Its VERY WELL documentaded and has much effort with just a few lines of code. Check the following helps:
It should not take more then 10 lines of code to do what you want.