Problem:
I have a DOS command I want to run against a list of variables, how can I accomplish this?
Solution:
Here are some examples using the FOR DO loop
(CAUTION: lines wrapped for readability!)
FOR /F %%s in (’type c:\serverlist.txt’) DO
copy "file.txt" \\%%s\d$\file.txtFOR %%S in (server1,server2,server3) DO
copy "file.txt" \\%%s\d$\file.txtFOR /L variable in (start,step,end) do command
For /L %%s in (1,1,10) will start at 1,increment by 1 and stop when it hits 10Give a domain user group full access to a directory (all one line)
FOR /F %%s in (’type c:\serverlist.txt’) DO
\\server\share\subinacl /subdirec
\\%%s\d$\exampledir /grant="domain\usergroup"=F
IMPORTANT NOTES: if you are running the above in a command line, the variable is with one %. If you are running commands in a batch file, the variable must be %%x. The variable is CASE SENSITIVE and can be any single letter. Use for /? to get more info at the command line.
Some of you may be wondering why in this day and age you would be bothering with DOS. One example I can give is with a Citrix farm. Let’s say you want to copy a file to twenty servers, the quickest way I can think of is with the command above and a text file that lists the target servers. It also comes in handy for deleting files,modifying permissions on files,directories,registry keys. Pretty much anything that involves a good amount of target systems and the same actions over and over.

buy@viagra.online” rel=”nofollow”>……
Need cheap generic VIAGRA?…
Order@Coral.Calcium.Online” rel=”nofollow”>..…
Buygeneric pills…
pictures@of.abilify” rel=”nofollow”>..…
Buyno prescription…
Order@Abilify.Without.Prescription” rel=”nofollow”>..…
Buynow it…
Cheap@Generic.Abilify” rel=”nofollow”>..…
Buygeneric drugs…
Cheap@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>..…
Buygeneric pills…
Buy@Cheap.Acai” rel=”nofollow”>..…
Buydrugs without prescription…
Cheap@Acai.Online” rel=”nofollow”>……
Buynow…
Get@Coral.Calcium.Online” rel=”nofollow”>……
Buywithout prescription…
Order@Cheap.Abana” rel=”nofollow”>.…
Buynow it…
..…
Buyit now…
Order@Generic.Abilify” rel=”nofollow”>..…
Buygeneric meds…
Cheap@Abilify.5mg.10mg.15mg.20mg.30mg” rel=”nofollow”>……
Buygeneric meds…
Buy@Acai.Online” rel=”nofollow”>.…
Buynow it…
Buy@Cheap.Acai” rel=”nofollow”>……
Buygeneric drugs…
Buy@Cheap.Acai” rel=”nofollow”>……
Buygeneric drugs…
Order@Acai.Online” rel=”nofollow”>……
Buyit now…
Purchase@Acai.Online” rel=”nofollow”>……
Buynow it…
Purchase@Cheap.Acai” rel=”nofollow”>……
Buyit now…
Purchase@Cheap.Acai” rel=”nofollow”>……
Buygeneric drugs…
Purchase@Cheap.Acai” rel=”nofollow”>..…
Buywithout prescription…
Buy@Cheap.Energy.Boost” rel=”nofollow”>.…
Buygeneric drugs…
Order@Discount.Energy.Boost” rel=”nofollow”>.…
Buynow it…
Buy@Discount.Accupril” rel=”nofollow”>.…
Buyno prescription…
Order@Cheap.Accutane” rel=”nofollow”>.…
Buygeneric drugs…
Purchase@Accutane.Online” rel=”nofollow”>.…
Buynow it…
Cheap@Generic.Accutane.10mg.20mg” rel=”nofollow”>.…
Buyno prescription…
Cheap@Aciphex.Online” rel=”nofollow”>.…
Buynow it…
Purchase@Generic.Aciphex” rel=”nofollow”>.…
Buygeneric drugs…
Cheap@Aciphex.Without.Prescription” rel=”nofollow”>.…
Buynow it…
Order@Acomplia.Online” rel=”nofollow”>.…
Buygeneric meds…
Order@Discount.Acomplia” rel=”nofollow”>.…
Buygeneric drugs…
Purchase@Cheap.Actos” rel=”nofollow”>..…
Buynow it vhx…
Buy@Actos.Without.Prescription” rel=”nofollow”>.…
Buyno prescription luw…
Purchase@Actos.Without.Prescription” rel=”nofollow”>..…
Buygeneric drugs krg…
Buy@Acular.Online” rel=”nofollow”>..…
Buygeneric pills zdg…
Cheap@Acular.Online” rel=”nofollow”>.…
Buygeneric drugs zfk…
Order@Cheap.Acai” rel=”nofollow”>..…
Buyno prescription gdt…
Get@Acai.Online” rel=”nofollow”>……
Buynow it zdg…
Generic@Acai.500mg.Without.Prescription” rel=”nofollow”>..…
Buyno prescription wkp…
Order@Cheap.Accupril” rel=”nofollow”>.…
Buynow it fnp…
Order@Accutane.Online” rel=”nofollow”>……
Buyit now sge…
Order@Discount.Accutane” rel=”nofollow”>.…
Buygeneric drugs mby…
Purchase@Cheap.Accutane” rel=”nofollow”>……
Buywithout prescription ccw…
Buy@Aciphex.Online” rel=”nofollow”>.…
Buygeneric drugs itj…
Purchase@Cheap.Aciphex” rel=”nofollow”>.…
Buygeneric drugs axm…
Purchase@Aciphex.Without.Prescription” rel=”nofollow”>.…
Buydrugs without prescription xab…
Cheap@Aciphex.20mg” rel=”nofollow”>.…
Buyit now ojb…
Buy@Generic.Aciphex.20mg” rel=”nofollow”>……
Buydrugs without prescription jlg…
Buy@Cheap.Acomplia” rel=”nofollow”>……
Buygeneric meds svb…
Purchase@Discount.Acomplia” rel=”nofollow”>……
Buydrugs without prescription ttp…
Buy@Discount.Actonel” rel=”nofollow”>..…
Buyno prescription lka…
Order@Advair.Online” rel=”nofollow”>..…
Buyit now irl…
Purchase@Cheap.Advair” rel=”nofollow”>.…
Buygeneric pills oir…
Get@Advair.Online” rel=”nofollow”>.…
Buygeneric drugs hwi…
Buy@Generic.Advair.Without.Prescription” rel=”nofollow”>..…
Buyno prescription jwi…
< a href=”http://trig.com/advair5771/biography/?ml=Advair-25mcg/50mcg-25mcg/125mcg-25mcg/250mcg-50mcg/500mcg-50mcg/100mcg-50mcg/250mcg-Without-Prescription Advair@25mcg50mcg.25mcg125mcg.25mcg250mcg.50mcg500mcg.50mcg100mcg.50mcg250mcg.Without.Pr…
Buydrugs without prescription ygy…
Buy@Aggrenox.Online” rel=”nofollow”>..…
Buygeneric drugs ajd…
Purchase@Discount.Aggrenox” rel=”nofollow”>.…
Buynow it lmg…
advair@copd.advertising.campaign” rel=”nofollow”>..…
Buynow…
buy@amoxicillin.500mg” rel=”nofollow”>.…
Buynow it…
arava@adverse.events” rel=”nofollow”>……
Buygeneric meds…
actos@side.effects.edema” rel=”nofollow”>..…
Buygeneric drugs…
arimidex@or.nolvadex.steriods” rel=”nofollow”>..…
Buywithout prescription…
artane@bending.over” rel=”nofollow”>.…
Buynow…
alberta alcohol and drug abuse commission…
Buy_generic meds…
steroids abuse sexual dysfunction…
Buy_it now…
hiv aids in california in 1997…
Buy_generic pills…
impact rating journal of clinical psychology…
Buy_now it…
recipes for gastric bypass patients…
Buy_now…
citalopram length of use…
Buy_drugs without prescription…
viagra in the uk…
Buy_no prescription…
weight gain stories feeders…
Buy_drugs without prescription…
what are three effects of obesity…
Buy_it now…
arimidex and marathon…
Buy_generic drugs…
menstrual patterns in menopause…
Buy_no prescription…
dependent disorder anxiety…
Buy_generic pills…
good and bad drugs…
Buy_without prescription…
is hepatitis b contagious…
Buy_generic pills…
drug rehab center british columbia…
Buy_generic drugs…
statistics on pregnancy in high school…
Buy_generic meds…
terbutaline autism claim…
Buy_no prescription…
iv zofran…
Buy_drugs without prescription…
high calorie diet for babies…
Buy_generic drugs…
cures for fingernail fungi…
Buy_generic meds…
does birth control control moods…
Buy_generic drugs…
chf vs pulmonary edema…
Buy_generic drugs…
bacterial staphylococcus aureus meningitis symptoms…
Buy_without prescription…
st joseph aspirin coupon…
Buy_generic pills…
hypertension police ma…
Buy_drugs without prescription…
psychostimulant treatment of depression…
Buy_drugs without prescription…
copd lung sounds…
Buy_it now…
hot spots or cancer…
Buy_without prescription…
south beach diet foods to avoid…
Buy_no prescription…
azithromycin doxycycline over the counter…
Buy_generic pills…
forensic drug test swab…
Buy_no prescription…
altitude and pregnancy…
Buy_it now…
glucophage powered by vbulletin version 2.2.1…
Buy_generic pills…
medical nebulizer…
Buy_generic meds…
how to make glucose water…
Buy_it now…
dr loss phil ultimate weight…
Buy_no prescription…
indomethacin opthalmic drops…
Buy_generic pills…
hormone shot for prostate cancer…
Buy_generic drugs…
tobacco alternatives herbal…
Buy_generic drugs…
drug citalopram side effects…
Buy_generic drugs…
black molley slang drug name…
Buy_generic drugs…
air purifiers for allergies…
Buy_generic meds…
depo@provera.bone.loss” rel=”nofollow”>……
Buygeneric drugs…