Tuesday, December 1, 2009

Use for loop in DOS

Example 1.

Register All dlls containing in folder:

Suppose you want to register 100 dlls containg in folder C:\dlls then goto command prompt

SOLUTION:
goto c:\dlls and write command below
for %i in (*.dll) do RegSvr32 -s %i

Example 2.

Print all files containg in folder

SOLUTION:
for %i in (*.*) do echo %i

No comments: