I have made batch file that can run diskpart but I want to do the following commands:
diskpart> list volume
diskpart> select volume 2
diskpart> remove letter d
Put your three commands in a text file:
list volume
select volume 2
remove letter d
Then pass the text file to diskpart:
diskpart.exe /s C:\mycommands.txt