Can't open selected file in windows explorer from application
-
@Niagarer
Would have been too easy. ;)did you try with quotes ?
explorer.exe /select,"e:\test.txt"
(in cmd)@mrjj
Yup, unfortunately also no solution... but then it does not open my documents folder, it just open the explorer
Slowly but surely it start to get funnyupdate
When I try to select, it just opens the explorer, if not, it opens the documents folder -
well it does open docs here too if no /select
if i do
.. /select,"file that dont exists"
it opens "This PC" -
well it does open docs here too if no /select
if i do
.. /select,"file that dont exists"
it opens "This PC"@mrjj
yes, the weird thing is, that the explorer defiantely knows the file. I even can search in the explorer search line and it finds the file.
But as you wrote, from cmd it can't find the file...
I can navigate to the right folder on the G drive, it still can't find the file -
@mrjj
yes, the weird thing is, that the explorer defiantely knows the file. I even can search in the explorer search line and it finds the file.
But as you wrote, from cmd it can't find the file...
I can navigate to the right folder on the G drive, it still can't find the file -
@Niagarer
But its only /select that is broken correct?
if you do other commands it does work?
like
type e:\test.txt -
@mrjj
No, I don't think so.
All the following commands don't work:// here it says, it could find that file... it is definately there notepad G:/test.txt explorer G:/ explorer /select G:/test.txt
-
Oh
in cmd
you must use \ that slash. not / .Qt makes it possible to use / but windows dont know it natively.
-
Oh
in cmd
you must use \ that slash. not / .Qt makes it possible to use / but windows dont know it natively.
@mrjj
Ok, I got it. Yes G is just another drive and it didn't work on any drive because:
I also noticed this \ and / thing and this was one of my mistakes.
Another thing, why cmd could not find one of my test.txt files I tried to open was that I named it test.txt (so the actual file name was test.txt.txt as my browser told me <facepalm x3>).
And one last thing, that is no less stupid is, that I sent the path from another object and this object did not send the .txt ending. Baad day :D
And I copied the path of some text files from the explorer and tried these, but the \ made it not working.
I thought thatQDir::toNativeSeperators(pathIn);
would fix \ to / (or \ on windows), but that seems to be wrong. It just takes normal paths with / and translates it to \ on windows http://doc.qt.io/qt-4.8/qdir.html#toNativeSeparators
Thank you very much for you help!
-
Ahh that is a classic :)))
I forgot about it.
Most stupid settings the history of windows as renaming the file will not actually work and you
get 2 x extension.