Windows Batch Scripting: I'm Stuck!?

techi3

In Runtime
Messages
119
Tonight's homework is out of control. I can't even do the first problem. When I run the batch file it says (FIND: parameter format not correct).

What is the output of the following batch file:

dir /s/p c:\*.vbs | find ping

I understand that dir /s/p is a listing of whatever directory with all files in a page by page format. It seems like it is searching the c:\ for any .vbs files or (|) find ping. I am lost :hide:
 
The | is known as a pipe and is used to direct the output of one command to the input of another. I believe the command should actually be dir /s/p c:\*.vbs | find "ping". Used this way, the output of the dir command would be searched using the find command and only lines containing the string "ping" would be listed in the output.
 
strollin, it worked. I appreciate it. The simplest syntax gets me every time, especially with UNIX scripting since there comparison operators are opposite of Perl and I think everyone else.
 
Back
Top Bottom