Discussion Locked

Yenter command in Batch Files?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Ok, help out an aging admin in need of a memorey upgrade! I recall vaguely seeing in an NT batch file somewhere an entry that resembled Yenter or Enter, its purpose was to provide a reply Y or N to a prompt from a command in a batch file. Example: Format a: FS:/FAT /X .
When run from a command line you get the prompt to Insert a Disk and Press enter and at the end 'Do you want to format another disk?'. How do I in Win2000, provide this answer in a batch file? Any other suggestions welcome. Oh, I am writing a batch file for virus removal. Thanks. Chris

5 replies

by r. a. caluste

there is an external command, CHOICE. i think you can get it from the CD (I am sure the win98 cd has it).

by firesheep43

Thanks, but the CHOICE choice (grin) did not do the trick. However, I think I will be able to use it elsewhere.

by beermonster

Hi,
Theres a couple of ways of inputting for commands that don't have a silent switch. the commonest is shown below, and types Y to the format command

echo y|format c:

If you need to send more than one command, you can try putting the commands into a file, and echoing that to the exe, heres one that I wrote for fdisk -

fdisk < a:\dat\fdisk.inp

where the fdisk.inp file contains

Y
1
2





hope this helps....

by firesheep43

Thanks - that is the ticket. However, the text you entered above for the fdisk example did not come through - could you email to me? cridley@drtel.net.

This discussion is closed to new replies.