|
Answer» I am in current directory have 2 files. One is a "abc.txt" file and one is "dt2.bat"
type abc.txt = TEST2
And type the command line below and work fine. for /f %i in (abc.txt) do sendevent -E SET_GLOBAL -G "DTRAN=%i"
autorep -G DTRAN
Global Name Value Last Changed DTRAN TEST2 01/11/2013 10:09:09
Now I create a batch file called: dt2.bat just like simple command on top. But run the dt2.bat not work. Keep SAY "The syntax of the command is incorrect." Please help what's wrong with this? Thanks
C:\PROGRAM Files (x86)\CA\Workload Automation AE\batch>dt2.bat
@echo off for /f %i in (abc.txt) do sendevent -E SET_GLOBAL -G "DTRAN=%i"FOR %i in (bla bla bla) do echo %i (command line) FOR %%i in (bla bla bla) do echo %%i (batch script)
I bet if you read the help file for the FOR command you will be enlightened. It will tell you exactly what Slamon Trout just showed you. READING is fun!Thanks SALMON Strout & Squashman. I am new with DOS batch. 😄Quote from: dtran on January 11, 2013, 10:32:35 PM I am new with DOS batch. All the more reason to read the documentation.
|