PDA

View Full Version : Dos



lance-tek
06-15-01, 03:05 PM
I need some fast help........ I want to delete a directory without a prompt. if I do a "deltree filename" it asks if I want to delet it y/n?


same thing if I try to "del foldername"

So I am asking if anyone can tell me how to write a script or what have you to get around the prompt?

BadEditor
06-15-01, 03:31 PM
You wound Enter deltree /Y (then the location)

:)

Joe
06-15-01, 04:09 PM
use a batch file if you want a script

lance-tek
06-15-01, 04:33 PM
THANK YOU BadEditor that is exactly what I was looking for :)

PING that was the intention, we jsut couldn't get the right command to bypass the prompt :p

now that I have it we can go on with the script :)

THANKS AGAIN

-JmE-
06-15-01, 10:06 PM
If you put a /? behind many DOS commands, you get command line switch information. For example:

C:\WINDOWS\Desktop>deltree /?
Deletes a directory and all the subdirectories and files in it.

To delete one or more files and directories:
DELTREE [/Y] [drive:]path [[drive:]path[...]]

/Y Suppresses prompting to confirm you want to delete
the subdirectory.
[drive:]path Specifies the name of the directory you want to delete.

Note: Use DELTREE cautiously. Every file and subdirectory within the
specified directory will be deleted.

C:\WINDOWS\Desktop>

-JmE-

Grimoire
06-16-01, 12:39 AM
Another way to do it that is much more fun that using /Y is to use: echo y | deltree <directory>. This will work with ANY dos command, such as echo y | format c: /u. Note that the | is the pipe character...should be shift-\.