DOSKEY Macro to Search for File Text (74038)
The information in this article applies to:
- Microsoft MS-DOS operating system 5.0
This article was previously published under Q74038 SUMMARY
The following DOSKEY macro searches all files in the current directory
for the message text specified and displays the output a screen at a
time. Any type of file will be searched, regardless of the file's
extension. When the macro is executed, the name of each file being
searched will be displayed along with the macro command. The macro
output will be displayed one screen at a time, which you can examine
to locate the message text you are searching for. Finally, the file
"output" is deleted so that when using the macro again, the file
output only represents one message search.
To create this macro, enter the following at the command prompt:
doskey search=for %a in (*.*) do c:\dos\FIND /i "$*" %a
$g$g output $t type output $b c:\dos\MORE $t del output
(Do not press ENTER until you have entered the whole macro.)
To run this macro, type:
The message does not require quotation marks and is not case
sensitive. The output of the search is displayed one screen at a time.
If the text is found, a line with the text will appear below the file.
Make sure the FIND and MORE commands in the above search macro are
referencing the MS-DOS 5.0 directory. Also, by using the FIND /i
switch, the message search will not be case sensitive.
Modification Type: | Major | Last Reviewed: | 11/22/1999 |
---|
Keywords: | KB74038 |
---|
|