Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 How to run diskpart from python script
Hello Everyone,

I'm looking to wipe several laptop drives using a bootable usb and a python script that will run diskpart and the list disk, select disk etc... commands.

Would anyone be able to help me with code that will run diskpart and then run;
list disk
select disk 0

Cheers Greg
Not a Windows user here, but there is a module infi.diskmanagement in Pypi that says

Quote:This module gives the same functionality as diskpart. But unlike diskpart, it does not use VDS, it uses SetupAPI and direct IOCTLs to the disks, volumes, and the mount and partitions managers

It could be worth trying.

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  How to kill a bash script running as root from a python script? jc_lafleur 4 416 Jun-26-2020, 10:50 PM
Last Post: jc_lafleur
  crontab on RHEL7 not calling python script wrapped in shell script benthomson 1 335 May-28-2020, 05:27 PM
Last Post: micseydel
  Package python script which has different libraries as a single executable or script tej7gandhi 1 695 May-11-2019, 08:12 PM
Last Post: keames
  Check Python version from inside script? Run Pythons script in v2 compatibility mode? pstein 2 6,904 Jul-07-2017, 08:59 AM
Last Post: snippsat
  Cant pass corect variables to python script in bash script neradp 3 3,165 Nov-05-2016, 01:26 AM
Last Post: Larz60+

Forum Jump:

Users browsing this thread: 1 Guest(s)