Haven’t seen a plain C and Win32 application in a very long time.
Some suggestions, if the author is reading the comments here:
I’m not sure why this GUI solution needs action.bat and diskpart.txt as separate files. I’d suggest moving the execution of diskpart.exe into main.c (this eliminates action.bat) and moving diskpart.txt into main.c with the GUI asking the user for the disk (if necessary).
Thank you very much for your suggestions. You are right, there is no real resilient reason why I do the job via action.bat and diskpart.txt. Originally, it was just to stay as flexible as possible (save time) and therefore be able to do without further compilation in case of error or improvement.
Thank you for your comment. The point is that the administrator should not have any extra work. Otherwise I think your solution is already conceivable.
Some suggestions, if the author is reading the comments here:
I’m not sure why this GUI solution needs action.bat and diskpart.txt as separate files. I’d suggest moving the execution of diskpart.exe into main.c (this eliminates action.bat) and moving diskpart.txt into main.c with the GUI asking the user for the disk (if necessary).