variables as paths to run?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
shokarta
Posts: 16
Joined: 14 Oct 2012 05:54

variables as paths to run?

#1 Post by shokarta » 13 Oct 2023 02:09

hello guys....

so lets say i have this line i need to run:

Code: Select all

c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe --qmldir c:\Qt\Projects\Sources\game_test c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe --compiler-runtime
so i was thinking of something like:

Code: Select all

set /p "windeployqt6"="c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set /p "sourceDir"="c:\Qt\Projects\Sources\game_test"
set /p "appPath"="c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"

%windeployqt6% --qmldir %sourceDir% %appPath% --compiler-runtime
but unfortunatelly this does not work... so how can I do this?

ShadowThief
Expert
Posts: 1162
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: variables as paths to run?

#2 Post by ShadowThief » 13 Oct 2023 03:31

The /p flag is only meant for prompting the user for input, and you only need quotes around the assignment, not on each side of the equals sign - this isn't an if statement.

Code: Select all

set "windeployqt6=c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set "sourceDir=c:\Qt\Projects\Sources\game_test"
set "appPath=c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"

%windeployqt6% --qmldir %sourceDir% %appPath% --compiler-runtime

Batcher
Posts: 74
Joined: 16 Apr 2009 10:36

Re: variables as paths to run?

#3 Post by Batcher » 14 Oct 2023 05:06

test-1.bat

Code: Select all

set "windeployqt6=c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set "sourceDir=c:\Qt\Projects\Sources\game_test"
set "appPath=c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"
"%windeployqt6%" --qmldir "%sourceDir%" "%appPath%" --compiler-runtime
test-2.bat

Code: Select all

set windeployqt6="c:\Qt\6.6.0\mingw_64\bin\windeployqt6.exe"
set sourceDir="c:\Qt\Projects\Sources\game_test"
set appPath="c:\Qt\Projects\Builds\build-game_test-Desktop_Qt_6_6_0_MinGW_64_bit-Release\appgame_test.exe"
%windeployqt6% --qmldir %sourceDir% %appPath% --compiler-runtime

Post Reply