{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


Operating_systems-page40 - Jelena Mamenko Operating Systems...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Jelena Mamčenko Operating Systems Lecture Notes on Operating Systems 40 Files on drive B: COMMAND.COM FILE.ONE FILE.LTR The batch subcommand we are investigating is: FOR %%Z IN (*.*) DO IF EXIST B:%%Z ECHO %%Z is on A: and B: Each filename on A: is substituted in the IF subcommand and then executed. To get the same effect you would have to type: IF EXIST B:COMMAND.COM ECHO COMMAND.COM is on A: and B: IF EXIST B:FILE.ONE ECHO FILE.ONE is on A: and B: IF EXIST B:FILE.TWO ECHO FILE.TWO is on A: and B: In the case of the example above, the first two would have a positive response and the last would not print anything. Study it carefully before going on! Another example: Files on drive A: COMMAND.COM FILE.ONE FILE.TWO Files on drive B: COMMAND.COM FILE.ONE FILE.LTR OK, told you to study the example. Let's see if you remember. What is the one line batch file command to find and report out all files starting with an "F" on drive A:?
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}