Page 1 of 1

execute folder content

Posted: 02 Dec 2008 08:38
by samy23
Hi Everyone!
Nice forum...like the style :-))

Well, I am not a complete stranger do DOS, but I`m stuck on something that seems to superseed my abilties.

I`ve been trying to execute the contents of a folder via a .bat file. Whenever I name the content of the folder by its exact name, e.g. notepad.exe, it works.
BUT when I try to execute everything inside with help of a wildcard, it does not.

Does anybody have an idea of how to go about?

Thanks in advance

Posted: 05 Dec 2008 01:50
by DosItHelp
samy23,

May be like this within a batch:

Code: Select all

for %%A in (*.exe *.bat *.com) do "%%A"

DosItHelp? :wink: