Computing.Net > Forums > Disk Operating System > how delete works ?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how delete works ?

Reply to Message Icon

Name: panyam
Date: August 27, 2009 at 05:18:47 Pacific
OS: Windows XP
Subcategory: General
Tags: XP
Comment:

How to delete a file in DOS. condition is that , suppose i have three files "file1","file1.txt", "file1.dat" ,..i want to delete all files except "file1"( a file without any extension).

Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: mavis007
Date: August 27, 2009 at 10:40:11 Pacific
Reply:

... this will leave file1 intact

del *.*t

.


.

... Posting is provided "AS IS" with no warranties
http://img515.imageshack.us/img515/...
Grrrr... ....more


0

Response Number 2
Name: Mechanix2Go
Date: August 27, 2009 at 11:26:32 Pacific
Reply:

More likely:

del *.??t


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 3
Name: Mike Newcomb
Date: August 29, 2009 at 02:48:02 Pacific
Reply:

Panyam - you advise your o/s is WXP.

Please bear in mind not all dos facilities are available when running under such o/s's, as they tend to provide only a subset of dos.

For native dos, I go with Mechanix's reply, which should have the desired result. Though possibly Mavis's will work as well.

Good Luck - Keep us posted.


0

Response Number 4
Name: klint
Date: August 29, 2009 at 04:31:50 Pacific
Reply:

All the three files you gave as an example have one thing in common: their extensions all end in the letter "t". Is that something you can rely on? Or is your requirement that you want to delete all files with ANY extension except those files that have no extension? (If that is the case, then the answers given so far will not be useful.)


0

Response Number 5
Name: MWCC
Date: August 29, 2009 at 10:03:23 Pacific
Reply:

What Mike Newcombe is saying is that you have no MS-DOS SubSystem, so this should of been in the PROGRAMMING FORUM, not the **-DOS Standalone O/S Forum...


0

Related Posts

See More



Response Number 6
Name: DAVEINCAPS
Date: August 29, 2009 at 14:55:26 Pacific
Reply:

Good grief. It's a simple question about the DEL command. There's no need for any redirecting or wrist-slapping. Besides the answer is the same whether stand-alone dos or command prompt.


0

Response Number 7
Name: klint
Date: August 30, 2009 at 00:16:18 Pacific
Reply:

It's a simple question, but the answer is not.

Assuming the question is "how do I delete all files except one?" here is one way (which would probably work in all OS from MD-DOS 6 upwards):

md temp
move file temp
del *.*
move temp\file .
rd temp

P.S. At this point I am starting to miss the time when I used to write DCL command procedures on DEC's VMS operating system. The above could be done with
DEL *.* /exclude=*.


0

Response Number 8
Name: DAVEINCAPS
Date: August 30, 2009 at 00:32:05 Pacific
Reply:

Yeah, I suppose there's always a complicated way to do something simple. Going that route how about:

ATTRIB +R *.
DEL *.*
ATTRIB -R


0

Response Number 9
Name: MWCC
Date: August 30, 2009 at 04:46:56 Pacific
Reply:

WHATEVER, the OP has disappeared....


0

Response Number 10
Name: Mechanix2Go
Date: August 30, 2009 at 05:08:19 Pacific
Reply:

DOS interprets

del *.*t

as:

del *.*

Don't take my word for it; try it yourself.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 11
Name: mavis007
Date: August 30, 2009 at 05:21:43 Pacific
Reply:

... xp command prompt's del *.*t

... will leave any file without an extension ending in "t" intact

... try it!


.


.............................. lol

.


... Posting is provided "AS IS" with no warranties
http://img515.imageshack.us/img515/...
Grrrr... ....more


0

Response Number 12
Name: Mechanix2Go
Date: August 30, 2009 at 06:25:50 Pacific
Reply:

"... xp command prompt's del *.*t

... will leave any file without an extension ending in "t" intact"

Sure. But this is the DOS forum.


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 13
Name: panyam
Date: September 3, 2009 at 00:45:14 Pacific
Reply:

Hi All ,

Thanks all for your comments. Sorry for the delayed
response. I rarely work in Dos as always i will be in Unix.

The issue is resolved how ever some thing like this :

for %%f in (access.???) do @echo del %%f | find "." >>
temp.bat
call temp.bat
del temp.bat


0

Response Number 14
Name: DAVEINCAPS
Date: September 3, 2009 at 12:17:39 Pacific
Reply:

Was the point here to find some kind of Rube Goldberg method to delete files? If so, job well done.


1

Sponsored Link
Ads by Google
Reply to Message Icon





Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: how delete works ?

how dos works www.computing.net/answers/dos/how-dos-works/8930.html

How to delete a PNG file in DOS www.computing.net/answers/dos/how-to-delete-a-png-file-in-dos/13034.html

How Dos works? www.computing.net/answers/dos/how-dos-works/9331.html