The Dreaded .bat

Discussion about everything. New games, 3d math, development tips...
Post Reply
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

The Dreaded .bat

Post by dejai »

Erm fi you know cmd please cast your eyes over the text.

Its so annoying trying to get this .bat script right

I am trying to make a search that will check the entire driver and all its sub directories for a "string" and a *.exe..

Find "string" *.exe

how do I get it to check all directories within a directory e.g c:

also anyone know how to copy whole directories correctly.
Programming Blog: http://www.uberwolf.com
deesine
Posts: 104
Joined: Fri May 12, 2006 9:19 am

Post by deesine »

/r walks the directory tree rooted at [drive:]path, type "for /?" in the prompt for more help on using it.

Code: Select all

for /r %%i in (*.txt) do find "test" %%i
This list occurences of "test" in all textfiles recursively from current directory.
If you do this directly from the command-line you'll have to change %%i to %i.

Edit:
For your copy problem, check xcopy, type "xcopy /?" at the prompt for info.
Post Reply