Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

please tell me the delete command in ms dos

Posted on 1999-06-29
8
Medium Priority
?
998 Views
Last Modified: 2010-04-30
please tell me the command for delete a file from what date to what date.
0
Comment
Question by:JOHNHO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 7

Accepted Solution

by:
KangaRoo earned 0 total points
ID: 1108305
There is no such command
0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1108306
Could abuse pkzip for that
  pkzip -m -t<FROMDATE> -T<TODATE> <zipfile> <filemask>
then delete <sipfile>
0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1108307
There may be other solutions to what you are actually trying to do. Dos comes with most neccesary comands to do file-management. What do you want to do?
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Expert Comment

by:mdietz
ID: 1108308
You could generate a file list by looking on the date of each file and pass this list to the del or erase command. That needs a bit batch programming, but it should work.
Another way could be to use file attributes as a deletion marker, but the main problem (generating a list of filenames) will be the same. You can sort by date with the dir command, but you still have to process the list to a file list erase can use
0
 
LVL 7

Expert Comment

by:KangaRoo
ID: 1108309
1. del will not except list with files
2. you cannot use date as criterium in a dir
3. using attributes may work, without creating list files. Simply mark files you want to keep as read-only, then delete (all) which will skip the marked files. Then set attributes back.
0
 
LVL 2

Expert Comment

by:mdietz
ID: 1108310
1. I did not speak about list FILES, I thought to PIPE the file list to the del command, but this could be a problem in older DOS versions
2. You can SORT by date and process the output to generate a file list (or at least the dir command in the Windows NT-DOS can!) This is for a faster batch program which stops after the last file you wanted to delete and does not have to process the whole directory.
3. You still need an automatism to set the attributes.

BTW: As you have to write a batch file to generate the list, if you only want to delete (and not use the list for other purposes like archiving or logging the state of your harddisk) this batch file can delete the files right after inspecting their date and you don't have any problems with piping the list to other commands.

And if everything else fails, you can still start Windows, open the explorer or the File Manager (in Windows 3.x) let the program sort by date and mark the files to delete as usual.
0
 
LVL 30

Expert Comment

by:serialband
ID: 2206108
The pkzip command is probably the esiest.  You could also download the XtreeGold 2.0 file manager.  It runs in dos.  I believe version 2.0 is the only free version.  3.0 is the last dos version and 4.0 was a lousy windows version that doesn't recognize long file names.
0
 
LVL 3

Expert Comment

by:vikiing
ID: 2206292
The use of PKZIP has one problem: it's not a true eraser, because after putting files into .ZIP container, you have to delete it.

Perhaps it's a good idea to execute a command like this:

PKZIP   -T  -t  -m  C:\WINDOWS\TEMP\TRASH.TMP *.*

where value for "-T" is the lowest date and "-t" the highest date.

It has an advantage: if you need to recover the file/s, you can get them back.
 
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: ErwindeVries
Released on the 7th of September this real time strategy game sets a new bar for any real time strategy game. R.U.S.E. is a game made by Eugen Systems and published by Ubisoft and released for the PC, Playstation 3 and the Xbox 360. The setting o…
For those of you searching for a fun but also medium paced MMORPG game I would highly suggest Ragnarok Online. This MMORPG is a bit older than World of Warcraft and in a way is extremely different. Compared to WoW's 3D environment and massive wor…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question