How can I do computer supposed pressed enter ?

My question is about c++

I am trying do a system program.
in this program the user can format his disks and another things...
but when I use system code
for example:
#include <stdlib.h>
system("format d:")

the computer is giving alert ! :
are you sure to format d,
please press enter if you are sure...

then the user press enter .
But I dont want to show this to user.

I want to my program press enter himself and format.
dont show this to the user.

Thanks.
You'll have to provide a little redirection.

 
system( "echo.|format d: >nul 2>&1" );


The lack of spaces around the pipe | is important.
Please don't use this for evil.
Last edited on
when you push that on program be sure that you have that stdlib.h on
you folder of application
Duas thanks TheNapster thanks too
I will not use it for evil things.
Topic archived. No new replies allowed.