c++ - QT Start explorer process parameters -


to start application in qt can use process function common languages, , can pass parameters in usual way. however, trying start explorer , pass parameter.

so code:

qprocess process; qstring test("/select,\"e:\\data\\testimage.dat\""); process.startdetached("explorer.exe", qstringlist() << test); 

should open explorer , highlight file testimage.dat, in folder e:\data. however, opens explorer , highlights documents.

so tried same function in c#:

string test = "/select,\"e:\\data\\testimage.dat\""; process.start("explorer.exe", test); 

this expect, opening explorer , highlighting file.

from see on here, qt code should same. using startdetached qt version works first time saying running. know arguments same copied , pasted them.

windows 8.1 , qt5.2 msvc10

solved still puzzled.

in command line, entry

explorer /select,"e:\data\testimage.dat" 

works, command

explorer /select,e:\data\testimage.dat 

doesnt.

a copy of command line works in c#. in qt, command

process.startdetached("explorer.exe", qstringlist() << "/select,\"e:\\data\\testimage.dat\""); 

works, when remove quotes, resultant line works fine

process.startdetached("explorer.exe", qstringlist() << "/select,e:\\data\\testimage.dat"); 

and when make test target see parameters arriving @ target are, quotes no longer present when sent c# or command line, when sent qt.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -