1

I feel I'm missing something obvious here, but I just can't see it. I have a cmd window open, and here's what I run:

set QTDIR32=C:\Qt\5.10.1\msvc2015
%QTDIR32%\bin\qmake.exe -v

C:\Qt\5.10.1\msvc2015\bin\qmake.exe is a valid path to an executable tool.
Expected: the tool's output.
Observed:

'C:\Qt\5.10.1\msvc2015' is not recognized as an internal or external command, operable program or batch file.

Tried various combinations of quotes around different parts of the command; tried start %QTDIR32%\bin\qmake.exe -v - it opens the 'C:\Qt\5.10.1\msvc2015' folder in Explorer.

echo %QTDIR32% prints the expected output.

What am I missing?

2
  • Care to explain the downvotes? Commented Apr 19, 2018 at 10:17
  • @Mofi: fair enough, but as I said in the question, it was never a batch file. I opened cmd.exe and typed these commands by hand. Then copied them and posted here. Commented Apr 19, 2018 at 14:25

1 Answer 1

1

Always use double quotes on paths.

set "QTDIR32=C:\Qt\5.10.1\msvc2015"
"%QTDIR32%\bin\qmake.exe" -v

The reason for double quotes are not always because of spaces between paths, but gets rid of any unwanted whitespace in the actual batch. double quotes are always a good idea.

Sign up to request clarification or add additional context in comments.

4 Comments

Hmm. This shouldn't be necessary here because the path has no spaces, and it shouldn't ever be necessary for the set command according to ss64.com/nt/set.html. Let me try your suggestion.
That did it, thank you (the quoted call to set). I'm starting to think I've had a stray space in the end of my path when calling set.
Yes, hence the quotes :)
I see your wisdom now :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.