Need a windows script

SpyderGST1 used Ask the Experts™
I have a .txt file with 600 lines each line is just one word. Actually word is a tape identifier. I need to update each tape with a command but I don't want to run this command 600 times.

for example: I have tape Tape1 and tape2
I need to run this command for both tapes

asvolrpolinit Tape1
asvolrpolinit Tape2
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Paste the script below into a text file with a .cmd extension.  Customize the value of the list variable on line 4 with the location of the text file.  Running the script will echo the commands to be run.  

Once you have tested it successfully and are certain it will do what you intend, remove the word ECHO from line 6 to execute the commands.

@echo off
set list=c:\list.txt
for /f %%G in ('type "%list%"') do ECHO asvolrpolinit %%G

Open in new window


worked like a charm. many thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial