I have this Windows 10 virtual environment where frequently I need to attach raw disk volumes to the virtual machine, then I need to run diskpart
on it to initialize it. I think I need Window Task Scheduler to do the job. So here are the steps:
- The volume is attached by the VM managing tool.
- The scheduled task founds that the volume is attached, then run the diskpart script.
The diskpart
part is easy, but how do I know if a volume is attached? I think it involves in using system events as task triggers, but what events should I look into?
Diskpart Logic
select disk 1
attribute disk clear readonly
online disk
convert mbr
create part primary
format quick
assign letter d:
exit
No comments:
Post a Comment