-
September 11th, 2002, 05:55 AM
#1
spawning (del command) DOS 7
I want to create a batch file that will delete all gid files throughout my hard drive.
looking at the deltree command:
Deltree
Deletes a directory and all the subdirectories and files in it.
Syntax:
To delete a directory and all the subdirectories and files contained therein:
DELTREE [/Y] directory
Obviously not only will it delete files but also directorys, not what I want at all.
I could try something like:
del c:\*.gid
but that would only delete gid files in a single directory not all sub directorys. I would asume this would not be dificult, useing perl I couldeasily do this kind of thig, but Im talking batch not perl.
Does someone know if there is a way to delete not only gid files under root but all sub directorys as well, I know in linux you can spesify the -r option to ask for recursive deletion.
Sugestions are welcomed.
-
September 11th, 2002, 06:25 AM
#2
I don't think there is an easy way of doing this.
What I have used in the past is the following command (from c:\)
DIR *.gid /s /w >temp.txt
This will list all the gid files, and save them in the temp.txt file
However, you will now need a program (any language like perl will do, as the output from this is very easy to process) to read the temp.txt file and change it into a series of DEL commands, which you can then execute as a batch file.
If you only have a few, then you can just print out or view the temp.txt and delete them manually.
No recursive option in DOS
-
September 11th, 2002, 06:31 AM
#3
Junior Member
Do you have to use DOS? The windows9x find will track down all the *.gid files (Search in windows 2000.) Then just delete what shows up. If you must use DOS try "DIR *.GID /S >giddel.bat" Then edit the file appending each line with del. Also, you will need to remove the size and date info. This would be the hard way, but I suppose if you have a lot of files to delete . . .
There was an old shareware program called Sweep that would help if it can still be found. It would display all the files and directories on the HD. You could then "tag" them then delete, move, copy . . .
Sorry, I am not a lot of help, but you are asking a dinosaur to remember old tricks.
With our Lords blessings take care,
Doug
-
September 11th, 2002, 06:33 AM
#4
Re: spawning (del command) DOS 7
Originally posted here by aj67my
I want to create a batch file that will delete all gid files throughout my hard drive.
Does someone know if there is a way to delete not only gid files under root but all sub directorys as well, I know in linux you can spesify the -r option to ask for recursive deletion.
Sugestions are welcomed.
This should do the job if you not have a strange version of dos
Code:
:: Deletes all .gid files on your C: drive.
c:
cd \
del *.gid /s
~micael
-
September 11th, 2002, 06:48 AM
#5
Re: Re: spawning (del command) DOS 7
Originally posted here by micael
This should do the job if you not have a strange version of dos
Code:
:: Deletes all .gid files on your C: drive.
c:
cd \
del *.gid /s
~micael
AFAIK this does not work (unless you are running some strange version of DOS that I don't know about)
-
September 11th, 2002, 06:49 AM
#6
Junior Member
I've been away from DOS too long. When did Bill sneak that one in?
-
September 11th, 2002, 07:00 AM
#7
This does work under NT, 2K, XP not sure about switches under 9x.
-
September 11th, 2002, 07:14 AM
#8
Yeah, the /s switch is not part of 9x - what version Windows are you using aj67my?
-
September 11th, 2002, 08:46 AM
#9
windows 98 SE, is what I am running so unfortunately I wont be able to use the s option,
I could verywell make a perl script that would do the task, or as sugested directory listing into a file, then use a script to read the file and execute a del comand for each file found. I am going to see if somewhere I can download the del command that comes with Windows XP, and replace mine with the new one, that might work.
I know that you can download the defrag that comes with Windows ME and replace the one in Win 98 with the one that Win ME has and it will run faster, aparently the defrag in Win me and above was writen beter.
So maybe appling that concept a simple replacement in my c:\windows\command directory may work. Or I could write my own dir command, and replace.
Thanks very much for the sugestions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|