General discussion

Locked

Batch File Asks User for Y or N

By BorgInva ·
In my batch file, in the process of doing what it does, I want to have it ask the user if they want to delete all folders (under the current folder that is) that start with "bak". So the command will delete all bak* folders if they hit Y, and if they hit N it will continue on with the rest of the script and not delete anything.
I have been searching for an hour but am tired tonight. Any ideas how I can do this? Thanks.
Oh, this batch is for 2000 and XP systems if that matters.
Thank you.

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

by lowlands In reply to Batch File Asks User for ...

You can try using CHOICE in your batch file

Collapse -

by BorgInva In reply to Batch File Asks User for ...

What if the PCs do not have CHOICE as it seems to be part of some resource kit. I have a thousand PCs and I am sure CHOICE is not on all of them.
Thanks.

Collapse -

Where to get choice from.

by Roger In reply to

You can copy choice.com from any computer that it is on to any other computer.

Collapse -

by bottomb In reply to Batch File Asks User for ...

This is for an automatic answer of "yes" to the delete command in a batch file:

In the Batch file:
del *.* < C:\y.txt

The text file:
Y <enter>

Put the txt file in root of c:

When the txt file is redirected to the bat file it enters the Y and the enter command.

Thanx, Bert

Collapse -

This is for an automatic answer of "yes" to the delete command in a batch f

by kiranreddyg In reply to

You can use eiher of the below:
echo y | del *.*
del /q *.*

Back to Software Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums