How do i create a console button so i dont have to go into Dev-c++ to open it

Dani AI

Generated

Following 's point that Dev‑C++ produces a Windows executable, the practical steps below show how to make a desktop "button" (shortcut or small wrapper) to launch a console program and what to do to run it on another PC. This expands on the thread without repeating exact lines from earlier posts.

To make a desktop shortcut:

  • Locate the compiled .exe in the program's output folder.
  • Right‑click the .exe and choose "Send to -> Desktop (create shortcut)" or "Create shortcut" then move that shortcut to the desktop.
  • Right‑click the shortcut, choose Properties and set "Start in" to the folder containing the .exe if the program depends on relative files.

A simple batch wrapper is useful when the console closes immediately or arguments/working folder matter. Put this in a .bat file and place a shortcut to the .bat on the desktop:

@echo off
"C:\full\path\to\myprogram.exe"
pause

If keeping the pause inside the program is preferred, use a small C++ end-of-program wait (Windows-specific):

#include <iostream>

int main() {
    // program logic
    std::cout << "Press Enter to exit...";
    std::cin.get();
}

Distribution notes for other machines: test the .exe on a clean PC or VM to discover missing runtime files. If the program needs extra DLLs (MinGW/GCC runtimes or third-party libraries), include those alongside the .exe or link statically when building (GCC/Mingw options such as -static / -static-libgcc / -static-libstdc++ can reduce external DLL needs, at the cost of larger binaries). For a polished installer, use an installer tool or supply a ZIP containing the .exe plus any required DLLs and a desktop shortcut. This addresses 's question about running the program outside Dev‑C++ and complements 's reply with actionable steps.

Recommended Answers

All 5 Replies

Your question is very confusing. Can you give us more detail?

Like when ever i want to use a console that i create in DEV-C++ i have to go into DEV-C++ to use it but i want to beable to make a link on my desktop to be able to open it without having to go through DEV-C++

Oh. You want to publish your program? Like, just have a single exe that you open and it would have the whole compiled program? Just go to the folder that your program is saved in and take out the exe. When dev-C++ builds, it makes an EXE of the program.

oh ok, thanks, that makes sense, cause how would u open it on another computer if u dont have that?

Thanks

oh ok, thanks, that makes sense, cause how would u open it on another computer if u dont have that?

Thanks

You would have to send them the exe.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.