How to pass command to command prompt without opening the prompt window ?

Morningdot Hablu

Morningdot Hablu

@morningdot-6Xuj4M Oct 25, 2024
Hello friend's
As we know by passing the command through batch file we can able to execute our java application just by double clicking the batch file.But our cmd prompt is opened in that case.
So i just want to pass the command to command prompt without opening the cmd prompt window.So how to make such like a batch file ?

Is there any function in c or c++ by which we can able to pass our command to command prompt ?

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • gaurav.bhorkar

    gaurav.bhorkar

    @gauravbhorkar-Pf9kZD May 14, 2011

    Use the /min parameter with start command in command prompt

    For example,
    start /min notepad.exe
    will start notepad minimized.
  • Morningdot Hablu

    Morningdot Hablu

    @morningdot-6Xuj4M May 14, 2011

    @Gaurav I think it will open cmd prompt window in minimized mode.But i want to do it without opening the prompt window.I have done this in java using utill package but don't know how this can be done in c or c++.
  • PraveenKumar Purushothaman

    PraveenKumar Purushothaman

    @praveenkumar-66Ze92 May 14, 2011

    You can start a new instance of the Command Line Interpreter... So, if you want to pass the commands, try this... Start » Run. 😁
    cmd [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF] [[/S] [/C | /K] string]
    For Eg., to turn the echo off, instead of putting @echo off, you can specify it in the command line this way...
    cmd /Q in the Run dialog box and press Enter key! 😀
  • PraveenKumar Purushothaman

    PraveenKumar Purushothaman

    @praveenkumar-66Ze92 May 14, 2011

    If you are asking in C / C++, then you can use this function.
    system("cmd /q")