1.

Solve : textfile contents as batchfile parameter?

Answer»

Dear Alll
i have been searching this subject for a long TIME
please help me ,,
i have created a batch file named test.bat
i have STORED one ip address in a text file
now i want to pass the contents of that text file (namely the id address) as a parameter to test.bat AUTOMATICALLY (or ATLEAST from command prompt in DOS)
pl tell me how to do this
earliest suggestions will be very much appreciated
thanks a lot


Code: [Select]@echo off
if not .%1==. goto SKIP
for /f %%i in (test.txt) do test.bat %%i
:skip
echo %1

This uses recursion to get the IP address from test.txt and then re-enter test.bat with the IP address passed along the command line. Use %1 when referring to the IP address in any code after the :skip label.

Happy Computing. 8-)



Discussion

No Comment Found