Computing.Net > Forums > Disk Operating System > Delete files without prompt

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Delete files without prompt

Reply to Message Icon

Original Message
Name: astroraptor
Date: August 16, 2002 at 10:48:40 Pacific
Subject: Delete files without prompt
Comment:

How would I DEL *.* without a prompt? I have no DELTREE command, I'm using MS-DOS 5.00.


Report Offensive Message For Removal


Response Number 1
Name: Hans
Date: August 16, 2002 at 11:09:36 Pacific
Reply: (edit)

del *.* /y >nul

This won't delete the subdirectories.


Report Offensive Follow Up For Removal

Response Number 2
Name: astroraptor
Date: August 16, 2002 at 15:08:21 Pacific
Reply: (edit)

Nope, doesn't work.


Report Offensive Follow Up For Removal

Response Number 3
Name: NULL
Date: August 16, 2002 at 21:46:33 Pacific
Reply: (edit)

Try this:

choice /n /t:y,1|del *.*>nul

be careful it will delete every file in the current directory without prompting.

hopes this helps :)


Report Offensive Follow Up For Removal

Response Number 4
Name: astroraptor
Date: August 16, 2002 at 21:52:11 Pacific
Reply: (edit)

Looked promising but it didn't work :(


Report Offensive Follow Up For Removal

Response Number 5
Name: NULL
Date: August 16, 2002 at 22:26:59 Pacific
Reply: (edit)

It works with MS-DOS Version 7 may be it wont work with MS-DOS 5. Sorry. Could you please tell me what is the output of the following code under MS-DOS version 5

choice /n /t:y,1|del *.*

thanx


Report Offensive Follow Up For Removal


Response Number 6
Name: Hans
Date: August 17, 2002 at 03:16:28 Pacific
Reply: (edit)

You can try this:
echo y|del *.* >nul


Or try this, I don't know if this work with the del command, but it works with format and fdisk commands:
Type this: echo y >c:\agree.txt
Then: del *.* nul

It can be, if you have a DOS version in another language that the Y must be replaced by another character, like J in my country.

I hope one of these things can help you further.


Report Offensive Follow Up For Removal

Response Number 7
Name: sidney
Date: August 17, 2002 at 13:52:50 Pacific
Reply: (edit)

del *.???


Report Offensive Follow Up For Removal

Response Number 8
Name: tech-fred
Date: August 18, 2002 at 02:30:34 Pacific
Reply: (edit)

Sorry Sidney that doesn't work either.

del will erase all ? combinations except
any combination that evaluates to a full
8.3 wild card. 7? ok, 8? not ok.

Tested on Toshiba DOS 5.0



Report Offensive Follow Up For Removal

Response Number 9
Name: chris
Date: August 18, 2002 at 07:55:19 Pacific
Reply: (edit)

This is quite easy to do using the "<" left arrow pipe command and should work in most versions of Dos. First use a basic text editor and create a text file that contains only the character "Y" and no formatting characters at all. Save the file (for example) as "Y.DAT". Copy it (again for example) to the c:\dos directory.

Now when you want to delete *.* in any dir without getting the Yes/No prompt, you just type:

del *.* Voila! :)

(this probably doesn't work in Dos-unfriendly XP and Win2000/NT but should work in all other versions of Dos)


Report Offensive Follow Up For Removal

Response Number 10
Name: chris
Date: August 18, 2002 at 08:05:15 Pacific
Reply: (edit)

me again. seems this forum doesn't handle the "<" character correctly. The last part above should have been:

DEL *.* okay, i was right. using the preview I can see there is some problem or bug that stopped the above syntax showing correct in my first post. by putting a " at the beginning and end of the line, it now shows okay. (I hope). So just remove the 2x " at the beginning and end. ...


Report Offensive Follow Up For Removal

Response Number 11
Name: chris
Date: August 18, 2002 at 08:08:39 Pacific
Reply: (edit)

AAAARRRRGGGGGGHHHHHHHHH!!!!!!!!! :(

I give up. I can type out what I want and it previews okay, but I CANNOT get the final post to show what I'm typing.

If the original poster wants me to email him, contact me at dennis_terry@mailcity.com

To repeat, i give up. Mod, please sort this out


Report Offensive Follow Up For Removal

Response Number 12
Name: chris
Date: August 18, 2002 at 08:14:53 Pacific
Reply: (edit)

I'm still here and having one more try. Try this syntax:

del *.* < c:\dos\y.dat

I've just put a space between the "<" and the "c" and I think that may work. can't check till I post, so here goes ....



Report Offensive Follow Up For Removal

Response Number 13
Name: chris
Date: August 18, 2002 at 08:16:28 Pacific
Reply: (edit)

Yippee!!!!!!!!! Synax correct.


Report Offensive Follow Up For Removal

Response Number 14
Name: astroraptor
Date: August 18, 2002 at 12:07:50 Pacific
Reply: (edit)

This works perfectly as well:

COPY %1 %2 >NUL
FOR %%A IN (%1) DO DEL %%A


Report Offensive Follow Up For Removal

Response Number 15
Name: scoot76
Date: August 29, 2002 at 11:29:07 Pacific
Reply: (edit)

how do i delete a file that is either too long or invalid



Report Offensive Follow Up For Removal






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home








Do you have a Desktop Computer anymore?

No
Yes, but only at work
Yes, but its rarely used
Yes, and its a workhorse


View Results

Poll Finishes Today.
Discuss in The Lounge
Poll History




Data Recovery Software