User forums > Using Code::Blocks
I can't run a command only build target
Miguel Gimenez:
Then, should the Run button be disabled always for Command only targets?
ollydbg:
--- Quote from: Miguel Gimenez on September 16, 2023, 12:55:41 pm ---Then, should the Run button be disabled always for Command only targets?
--- End quote ---
I think for a command only targets, when I build this target, it just run some commands.
What is the result of the running commands, maybe it generate an exe file? In this case, "Run" button is needed.
In-fact, I have other minor issues about the "command only targets", I see that the "Search directories" in the Build option is disabled. Which means if I have a to add some code in my command to add a directory to the PATH variable when I "Build" the target. I'm not sure you understand this, I mean in normal Console or GUI targets, the "Linker's search directories" is automatically added to the PATH when I "Build" or "Run" the targets. But currently I can't edit that field.
This is a example cmd(named AAA.cmd), the contents are like below:
--- Code: ---@echo off
set "current_path=%~dp0"
set "new_path1=%current_path%lib"
set PATH=%new_path1%;%PATH%
start "" /wait "C:\Program Files (x86)\AAAAA\ABC.exe"
--- End code ---
Then I have put the below code in the "pre or post build steps" in the command only target's build options.
--- Code: ---cmd /c AAA.cmd
--- End code ---
Navigation
[0] Message Index
[*] Previous page
Go to full version