various commands in one

How do i make multiple commands in the "DISKPART" with a c++ program?
On the cmd we have to put like:
DISKPART enter
select disk 0 enter
select partition 1 enter
active enter

how to do that on c++?
Write the commands to a text file and then shell out diskpart: diskpart /s <filename>, where <filename> is the name that contains the diskpart commands written by your C++ program.
Where do i save it?
Nevermind I got it.
Thank you.
Topic archived. No new replies allowed.