Qt5 - Windows 10
Hello,
I'm using QProcess to run DISKPART to create a 1.5gig FAT32 partition on an SD card.
The problem I have is that I have to run QProcess twice for it work.
If I run it once, the SD card ends up empty and unformatted.
It seems I have an error in QProcess or the DISKPART script,
maybe some time delays?.
Any ideas, please?
Regards
Code:
QString program = "diskpart.exe";
QStringList arguments;
arguments << "/s" << filename;
for (int i = 0; i < 2; i++)
{
process = new QProcess(this);
process->start(program, arguments);
process->waitForStarted(-1);
process->waitForFinished(-1);
process->terminate();
process->close();
process->deleteLater();
}
Code:
filename (script):-
select disk 1
clean
create partition primary size=1536
active
format fs=fat32 label=Noobs quick