User forums > Using Code::Blocks

Run shell script with the "Run" button

<< < (2/3) > >>

Yargh:

--- Quote from: jens on March 19, 2011, 07:52:31 pm ---You can try to create a batchfile (I guess you are on windows, because you use cygwin, on linux use a shell-script) that calls the commands you need and set it as "Output filename" in the projects "Properties -> Build targets -> [the target you use]".

--- End quote ---
That method doesn't seem to work. I have auto-generate file prefix and extension off, and I made a run.bat file to run the command and set that as the output file name. Clicking the run button does nothing. However, opening cmd and cd'ing to the directory which it is set to run in and calling it ("..\run.bat") launches it fine. Also, I don't need console output as I'm running it in qemu.

Configuration:


Run.bat:

--- Code: ---C:\qemu\qemu.exe -m 32 -fda kernel.img -boot a

--- End code ---

The run.bat file should work fine if it's actually getting run in the correct directory.

EDIT: By does nothing, I mean that qemu doesn't open and no output shows up in the console.

Jenna:
If the batch-file is not in the projects root directory, you have to specify the path to it in the "Output file" text-box.
The easiest way is to use the button ( [...] ) of the text-box to pick up the correct filename and path with the file-dialog.

Yargh:
The batch file IS in the project's root directory, and I have used the browse button to locate the path. It still does nothing.

Jenna:
Please copy the content of the "Build log" after clicking on the run button and post it here.

Yargh:

--- Code: ---
--- End code ---
Nothing shows up in the build log.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version