I am trying to copy multiple files to a destination folder in Qt 4.8 using QProcess
named copyProcess. The thing is when I use this command, nothing happens, in cmd, it shows invalid syntax.
The value which I get from the StringList
is this
for %I in (", "C:/Users/xyz.mp4","C:/Users/V46.srt","C:/Users/FP.txt",")","do copy %I", "C:\Users\Nina\Desktop\New folder (9)")
d->copyProcess = new QProcess(this) ;
QStringList copyProcessParameters;
// copyProcessParameters.append("-rf");
Q_FOREACH(QString fileName, fileNames)
{
d->totalFileSize += this->getSize(fileName);
d->filesToCopy.append(fileName);
}
copyProcessParameters.append(d->filesToCopy);
copyProcessParameters.append("do copy %I");
copyProcessParameters.append(destinationDir);
d->copyProcess->start("for %I in", copyProcessParameters);
So is there a way I can use the batch script in qt that way that it can copy multiple files at once ?