Posted By

Scooter on 09/12/08


Tagged


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

wizard04
cementboot
Tyster


Perform an action on all files in a folder


 / Published in: DOS Batch
 

I wanted a way of performing the same action on a collection of files without having to explicitly write out the name of each file in my batch file. The following code provides two working examples. All I need to do is add more files to the corresponding folder and they will be included the next time the batch file is run.

  1. FOR %%i IN (regtweaks\*.reg) DO regedit /s %%i
  2.  
  3. FOR %%i IN (msi\*.msi) DO msiexec /qb /i %%i REBOOT=ReallySuppress

Report this snippet  

You need to login to post a comment.