title: Batch file Loop through list
body: <p>I am still pretty new in this field so I apologize ahead of time if there is incorrect verbiage used. I am looking for a way to have my batch file loop and repeat the same process over once completed only using a different number for %3 from a list of numbers. The list of numbers for %3 are less than 100 so I do not mind writing them out in the Batch file it just becomes tedious waiting for the command to finish and writing the next number. Also these numbers are not in sequence (i.e. 1-100) but scattered (i.e. 2, 6, 21, 48). Any and all help is greatly appreciated. Thanks in advance for your time. </p>
  
  <pre><code>@ECHO OFF
  
  ECHO ==============STORE #%3================ &gt;&gt;EM_Push.log   
  ECHO %date% &gt;&gt;EM_Push.log 
  ECHO %time% &gt;&gt;EM_Push.log
  IF EXIST d:\micros\res\em\transport\send\0%3\*.mpz goto start  
  IF NOT EXIST d:\micros\res\en\transport\send\0%3\*.mpz goto nofile
  
  
  :START 
  ECHO ---------Mapping Drive------------ &gt;&gt;EM_Push.log
  net use s: /d
  net use s: \\10.16.%3.101\d$ /user:%1 %2 &gt;&gt;EM_Push.log  
  IF NOT EXIST s:\micros ECHO POSSIBLE NETWORK ISSUE &gt;&gt;EM_Push.log   
  IF NOT EXIST s:\micros goto end
  
  ECHO ----------Copy Package from EM to Store %3----------- &gt;&gt;EM_Push.log  
  copy d:\micros\res\em\transport\send\0%3\*.mpz s:\micros\res\em\transport\receive &gt;&gt;EM_Push.log
  IF NOT EXIST d:\micros\res\em\transport\send\0%3\archive md d:\micros\res\em\transport\send\0%3\archive
  move d:\micros\res\em\transport\send\0%3\*.mpz d:\micros\res\em\transport\send\0%3\archive &gt;&gt;EM_Push.log
  
  ECHO --------Deploy Package-------------- &gt;&gt;EM_Push.log
  psexec \\10.16.%3.101 -u %1 -p %2 d:\micros\res\em\bin\receive.exe &gt;&gt;EM_Push.log
  psexec \\10.16.%3.101 -u %1 -p %2 d:\micros\res\em\bin\deployment.exe &gt;&gt;EM_Push.log
  
  REM ECHO ---------Exit41 Update------------- &gt;&gt;EM_Push.log
  REM IF EXIST s:\exit41\commands\pagepull.exe psexec \\10.16.%3.101 -u %1 -p %2 d:\exit41\commands\pagepull.exe &gt;&gt;EM_Push.log
  REM IF EXIST s:\exit41\commands\pagepull.exe ECHO Done! &gt;&gt;EM_Push.log
  REM IF NOT EXIST s:\exit41\commands\pagepull.exe ECHO Not subscribed to Exit41 &gt;&gt;EM_Push.log
  
  ECHO ----------Copy Confirmation from Stor %3 to EM----------- &gt;&gt;EM_Push.log
  IF NOT EXIST s:\micros\res\em\transport\send\*.mpz ECHO RECEIVE PACKET NOT AVAILABLE &gt;&gt;EM_Push.log
  IF NOT EXIST s:\micros\res\em\transport\send\*.mpz goto end
  copy s:\micros\res\em\transport\send\*.mpz d:\micros\res\em\transport\receive &gt;&gt;EM_Push.log
  IF NOT EXIST s:\micros\res\em\transport\send\archive md s:\micros\res\em\transport\send\archive
  move s:\micros\res\em\transport\send\*.mpz s:\micros\res\em\transport\send\archive &gt;&gt;EM_Push.log
  
  goto end
  
  :NOFILE
  ECHO NO UPDATES FOR THIS STORE  &gt;&gt;EM_Push.log
  
  :END
  net use s: /d &gt;&gt;EM_Push.log
  ECHO==============END STORE #%3============= &gt;&gt;EM_Push.log
  </code></pre>