Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Visual Basic Programming › Sending command to console application

Sending command to console application

Posts 1–11 of 11 · Page 1 of 1
Mayion
[MPGH]Mayion
Sending command to console application
Hi,
I've created a console application using C++, Is there any way to send for example textbox text to the console?
I tried
Code:
Shell("Console.exe /k" + textbox1.text)
but didn't work, only opens the console without inserting the command/text.
Any help is appreciated, Thanks.
#1 · 12y ago
Biesi
Biesi
Code:
Process.Start("Console.exe", "/k " & TextBox1.Text);
#2 · 12y ago
ER
ERGaergaergaergaergearg
Wait, just to make clear.

You created a C++ Console Application. But you wanna insert commands to cmd using TextBox?

Does Console application have a textbox?
Did not know that.
#3 · 12y ago
Mayion
[MPGH]Mayion
Quote Originally Posted by Biesi View Post
Code:
Process.Start("Console.exe", "/k " & TextBox1.Text);
Same results, nothing.

Quote Originally Posted by gresan6 View Post
Wait, just to make clear.

You created a C++ Console Application. But you wanna insert commands to cmd using TextBox?

Does Console application have a textbox?
Did not know that.
I didn't even mention cmd.
I meant, I created a C++ console application & want to send a command from my VB.NET form to it (the console).
#4 · 12y ago
Biesi
Biesi
Maybe it's your C++ Console then
#5 · 12y ago
Mayion
[MPGH]Mayion
Quote Originally Posted by Biesi View Post
Maybe it's your C++ Console then
It's a normal console, why would it be the issue.
#6 · 12y ago
abuckau907
abuckau907
@Mayion Shell("Console.exe /k" + textbox1.text) what is the argument type for the Shell() function, what data type?

And in the C++ program, where it gets the arguments..what data type is this?

If you don't know, maybe it's worth investigating.

If it was me, I'd add some code to the beginning of main() (ie. don't let your normal code run) in the C++ app and MessageBox() the first argument passed to it..at least then you'll know when the C++ side thinks it got an argument passed in. Then try things on the vb side which possibly send different strings (see my first 2 questions).

The function mentioned by Biesi should (...does) work, must be your console app.

Post code...pretty much always --> use [ s p o i l e r = zCode ] ... [ / s p o i l e r ] if you don't want it to take up a lot of space.

edit: change char to wChar on your C++ side because the vb-side is sending a utf16 string, and the console is expecting 1-byte ascii? Or maybe it's the opposite? I haven't used the Shell() function, but I promise the one mentioned by Biesi works.. I guess give us more details like OS,cpu_size/compiled as x86/x64, which version of V$. and POST CODE.
edit2: Biesi noticed --> OP, Did you mean to put a space after the "/k" or not? Maybe this is causing the C++ program to act like it didn't get the argument (which is why I mention the MsgBox() idea).
#7 · edited 12y ago · 12y ago
Mayion
[MPGH]Mayion
Quote Originally Posted by abuckau907 View Post
Post code...pretty much always --> use [ s p o i l e r = zCode ] ... [ / s p o i l e r ] if you don't want it to take up a lot of space.
I'm using a really simple code of Crosshair (I think you already know it).
 
Code

bool crosshairon=false;
HDC ragedc = NULL;
int crosshairsize=0;
int cx=0;
int cy=0;


void CrossThread(void)
{
while(1)
{
if(GetAsyncKeyState(VK_NUMPAD1)&1)
{
crosshairon=!crosshairon;
ragedc = GetDC(HWND_DESKTOP);
cx=GetSystemMetrics(SM_CXSCREEN)/2-((crosshairsize-1)/2);
cy=GetSystemMetrics(SM_CYSCREEN)/2-((crosshairsize-1)/2);
}
Sleep(1);
}
}

int main()
{
SetConsoleTitle(L"TTLE");
cin>>crosshairsize;
if(crosshairsize%2==0) //check if its even
{
crosshairsize+=1; //if it is add 1
}
cout<<"\n";
CreateThread(0,0,(LPTHREAD_START_ROUTINE)CrossThre ad,0,0,0);
while(1)
{
if(crosshairon==true)
{
for(int i=0;i<crosshairsize;i++)
{
SetPixel(ragedc, cx+i, cy+((crosshairsize-1)/2), RGB(255,0,0));
SetPixel(ragedc, cx+((crosshairsize-1)/2), cy+i, RGB(255,0,0));
}
}
Sleep(1);

The thing I want is, to send the CRHair size & press enter.
#8 · 12y ago
abuckau907
abuckau907
cin>>crosshairsize;

you expect this to input the first argument into crosshairsize?


edit: does that actually work??? Can you start the program from command line and successfully pass in an argument?
And what does the /k do? I assumed it was something to do specifically with the shell() function ..looks like your program isn't using it..?
#9 · edited 12y ago · 12y ago
Mayion
[MPGH]Mayion
Quote Originally Posted by abuckau907 View Post
cin>>crosshairsize;

you expect this to input the first argument into crosshairsize?


edit: does that actually work??? Can you start the program from command line and successfully pass in an argument?
And what does the /k do? I assumed it was something to do specificly with the shell() function ..looks like your program isn't using it..?
It worked after removing
cin>>crosshairsize;
& editing
if(crosshairsize%2==0)
Thanks but why did it work after removing the cin>>crosshair?
#10 · 12y ago
abuckau907
abuckau907
because crosshairsize is initialized to 0 and then you +1'd it..crosshair size will always be 1? lol :/

edit:
learn how to make your main() function take 2 arguments (an 'argument count' integer,and a pointer to a character array). That's how everyone else does command like arguments.

How you not gonna answer my questions..I even bolded them so you'd notice : ( Are you actively trying to avoid learning?

--Apparently you understand the GetAsyncKey() thing.... just default the crosshairsize to 1 like you're already doing and then add a key for "make larger" and "make smaller" : p probably easiest solution for you.
#11 · edited 12y ago · 12y ago
Posts 1–11 of 11 · Page 1 of 1

Post a Reply

Similar Threads

  • [Help]Send Command To Console FunctionBy ♪~ ᕕ(ᐛ)ᕗ in Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    10Last post 15y ago
  • Send Command To console example codeBy 1ackass in Call of Duty Modern Warfare 2 Coding / Programming / Source Code
    2Last post 13y ago
  • [?] Send commands to console by writeprocessmemory !?By WhiteLionATX in Call of Duty Black Ops Coding, Programming & Source Code
    3Last post 15y ago
  • Send command to console in VB.netBy pyton789 in Call of Duty Black Ops Help
    12Last post 15y ago
  • What's the point of Console applications?By 258456 in C++/C Programming
    2Last post 16y ago

Tags for this Thread

None