Jump to content

auto Yes in batch file?

Guest K1u

Recommended Posts

Ok if i made a batch file for example-

cd C:WINDOWSsystem32

del crapshack

If crapshack is a folder when u run the batch file file u will get a Y/N message if u want to delete how can i make it automatically say yes in batch file?

Link to comment
Share on other sites

  • 1 month later...
Deletes one or more files.

DEL [/P] [/F] [/s] [/Q] [/A[[:]attributes]] names

ERASE [/P] [/F] [/s] [/Q] [/A[[:]attributes]] names

names Specifies a list of one or more files or directories.

Wildcards may be used to delete multiple files. If a

directory is specified, all files within the directory

will be deleted.

/P Prompts for confirmation before deleting each file.

/F Force deleting of read-only files.

/S Delete specified files from all subdirectories.

/Q Quiet mode, do not ask if ok to delete on global wildcard

/A Selects files to delete based on attributes

attributes R Read-only files S System files

H Hidden files A Files ready for archiving

- Prefix meaning not

If Command Extensions are enabled DEL and ERASE change as follows:

The display semantics of the /S switch are reversed in that it shows

you only the files that are deleted, not the ones it could not find.

Link to comment
Share on other sites

i also highly recommend checking out http://www.ss64.com/nt/index.html

there is a lot of detailed information about window's command line applications and their syntax and sample scripts

and for quick help with any command it's always good to run the command with /? or -h or /help or --help as they usually list the syntax and usage it's that does not work google it

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...