Good evening everyone,
I have been working on developing a simple batch file to delete files on
local hard drives to be used on computers @ my school (I'm part of our
school's tech team & have permission to do this). Basically the batch
file looks like this:
DEL C:\windows\sol.exe
DEL C:\windows\mshearts.exe
DEL C:\windows\winmine.exe
DEL C:\windows\winpopup.exe
DEL C:\windows\*.pwl
As you can see I'm basically deleting all of the included Win95 games,
plus a couple other things that it is better off not to have on the
computer (don't need any teenagers having cybers** over the high
school's network, & then attempting to crack into other people's
accounts).
But somehow some of these files have gotten moved to other locations on
the hard drive, so that users can access them from there.
Basically what I would like to do is perform:
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)
If someone has any suggestions I would greatly appreciate it. The other
approach I was considering was using some of my basic knowledge of C++
to develop the program, b/c reading files is much easier that way, but I
don't have any idea how to execute the necessary DOS commands to
generate the directory listings or delete the file from within the C++
program.
--
Bye for now,
Dave C.
[log in to unmask]
http://www2.cybernex.net/~pepermil/
http://www2.cybernex.net/~pepermil/os/
PCSOFT mailing list is brought to you by:
The NOSPIN Group
http://nospin.com
|