At 09:28 PM 11/12/98 -0500, you wrote:
>
>DIR sol.exe /s /b > output.txt
>& then I would like to have the batch file read in each line from the
>text file performing:
>DEL "line of output.txt"
>
>My problem, however, is that I do not know how to have the batch file
>read in a line from the file & then output it to a line with the DEL
>command in front of it & quotes around it (for compatibility with Win95
>long file names)
The functions you need to search for a file are "findfirst" and "findnext".
However, there is a lot of messy code needed to do a full system search.
You would be better off to combine the two methods. Do the DIR as you have
given it to write the files' locations into a file. Write a C program that
will read the file one line at a time and concatenate the DEL and the
quotes around the file name and write it back out to another file named
with a BAT extension. After your C program has run, simply CALL your new
BAT file to delete the files. I think I have a program I wrote in Turbo C
3.0 a long time ago that does something similar to this. If I can find it
and you want the source code, please send me a direct email and I will send
it off to you.
PCSOFT's List Owner's:
Bob Wright<[log in to unmask]>
Drew Dunn<[log in to unmask]>
|