Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

A question about BAT


Mb0742's Avatar
Ultimate Headshot
0 0

I've seen this script before I just don't know what to query Google for. It's a script that runs and shows like a normal cmd prompt you type in a command and it executes it within itself and when the commands ends it jumps back to the start of the batch. (I need to be able to get into cmd wherever I am).


Uber0n's Avatar
Member
0 0

How about just doing this? You'll be surprised how often it works :)

Contents of file.bat

CMD```

If that is blocked, replace the CMD line with COMMAND to get into the "old cmd prompt" and run CMD from there ;)

Mb0742's Avatar
Ultimate Headshot
0 0

that works yes but I have a lot of .exe that can only run while in cmd to, this is the main reason ;)


ghost's Avatar
0 0

Write a C++ program that get input and then passes that to a system() call?


hellboundhackersok's Avatar
Banned
0 0

Ok well ping doesn't work.. I'll try to fix it.. I think it's because ping takes a parameter :@


spyware's Avatar
Banned
0 0

Always post source, and if you wish, post binaries.


hellboundhackersok's Avatar
Banned
0 0

Ohh right. here it is: (Extremely basic BTW)

#include <iostream>
#include <string>

int main()
{
	using namespace std;

	string Input = "NULL";

	cout << "Enter the command to execute: ";

	cin >> Input;

	system(Input.c_str());

	cout << endl;
	system("PAUSE");
	return 0;
}

Ping doesn't work btw LOL

EDIT: I've found out what you can do.. instead of trying to directly ping something from this program.. Just type cmd… then you can do whatever.