3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windows環境でパーティション操作やフォーマットを非対話で行う方法

Posted at

Windows環境でパーティション操作を非対話で行う方法

機会があったのでメモ、対話型コマンドのdiskpartのコマンドを上からそのまま並べて、それを適当なテキストファイルに記述しておく。

select disk 2
clean
create partition primary size=1024
select partition 1
active
create partition primary
select partition 2
format fs=ntfs quick
active

あとは、このテキストファイルをコマンドプロンプトから、diskpartに食わせれば非対話でパーティションやフォーマットが行われる。

diskpart /s partition.txt

実行結果はこんな感じ

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?