General discussion

Locked

Yenter command in Batch Files?

By firesheep43 ·
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 <Y>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

This conversation is currently closed to new comments.

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

All Comments

Collapse -

Yenter command in Batch Files?

by R. A. Caluste In reply to Yenter command in Batch F ...

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

Collapse -

Yenter command in Batch Files?

by firesheep43 In reply to Yenter command in Batch F ...

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

Collapse -

Yenter command in Batch Files?

by BeerMonster In reply to Yenter command in Batch F ...

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....

Collapse -

Yenter command in Batch Files?

by firesheep43 In reply to Yenter command in Batch F ...

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.

Collapse -

Yenter command in Batch Files?

by firesheep43 In reply to Yenter command in Batch F ...

This question was closed by the author

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

Related Discussions

Related Forums