QT调用CMD命令求助
xxxxx.exe -z -rd input="C:\Users\xxx\xxx\xxx" -r "C:\Users\xxxx\xxx\xxxx"有上面一行指令 ,我如何通过QT调用CMD来运行这行指令呢,里面包含文件路径实在搞不懂了,求助各位大佬。 QProcess::execute("xxx.exe", { "-z", "-rd", "input=...", "-r", "path..." }); ryosga 发表于 2021-8-20 14:08
QProcess::execute("xxx.exe", { "-z", "-rd", "input=...", "-r", "path..." });
不是呀 是调用cmd来运行这行指令,不是直接调用这个xxx.exe system("xxxxx.exe -z -rd input=\"C:\\Users\\xxx\\xxx\\xxx\\" -r \"C:\\Users\\xxxx\\xxx\\xxxx\\""); JuncoJet 发表于 2021-8-20 14:44
system("xxxxx.exe -z -rd input=\"C:\%users\\xxx\\xxx\\xxx\\" -r \"C:\%users\\xxxx\\xxx\\xxxx\\"");
不行哎 这么写报错啊 大概是这样
QProcess::execute("cmd.exe", { "/c", "xx.exe", "-z", "-rd", "input=...", "-r", "path..." }); Jack2002 发表于 2021-8-21 16:30
大概是这样
QProcess::execute("cmd.exe", { "/c", "xx.exe", "-z", "-rd", "input ...
"/c"是什么意思啊,我用QProcess调用cmd不成功也不知道为啥 Meng19960229 发表于 2021-8-23 11:17
"/c"是什么意思啊,我用QProcess调用cmd不成功也不知道为啥
/c 就是close,执行命令后自动关闭cmd.exe
页:
[1]