Today I saw a command like this in some DOS books, but I don't understand exactly how it is used, and I don't really understand what it means either. I'd like the experts to give me some guidance!!
1。 The batch file below will repeatedly display the contents of several specified files:
c:\>type demo2.bat
for %%x in (%1 %2 %3 %4) do type %%X
c:\>
What I want to ask is;
1。 %1 %2 %3 %4 are originally parameters of the batch file, so what is the purpose of putting them inside the parentheses in the command above? How do we define the values of its parameters?
And also, I often see expressions like %cdrom%. What do the % signs on both sides mean? Under what circumstances can expressions like these be used? Please give me some guidance...
1。 The batch file below will repeatedly display the contents of several specified files:
c:\>type demo2.bat
for %%x in (%1 %2 %3 %4) do type %%X
c:\>
What I want to ask is;
1。 %1 %2 %3 %4 are originally parameters of the batch file, so what is the purpose of putting them inside the parentheses in the command above? How do we define the values of its parameters?
And also, I often see expressions like %cdrom%. What do the % signs on both sides mean? Under what circumstances can expressions like these be used? Please give me some guidance...



