Follow us on Twitter!
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill
Thursday, April 17, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 20
Guests Online: 17
Members Online: 3

Registered Members: 82822
Newest Member: TheBunter
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

C++ code to wright a bat file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-09-06 14:05
Can someone tell me how to do a program that
make a bat file and wright some code in it.

Please make a little example of code
here in the Thread.

//wildzor

Edited by on 17-09-06 15:02
Author

RE: hust921

hust921
Member

Your avatar

Posts: 26
Location: Denmark
Joined: 05.08.06
Rank:
Newbie
Warn Level: 70
Posted on 17-09-06 16:42
Code

#include <fstream>
using namespace std;

int main()
{
  ofstream Fil("something.bat", ios::app);
  Fil<<"@echo off"<<endl;
  Fil<<"echo Hallo,world"<<endl;
  Fil<<"pause"<<endl;
  Fil.close();
  return 0;
}






This code will make a batch file look like this:

Code

@echo off
echo Hello, world
pause





hust921B)
Author

RE: C++ code to wright a bat file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-09-06 16:54
ok thanx so mutch Smile
Author

RE: C++ code to wright a bat file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-09-06 22:24
You also could skip the batch file. if all your trying to do is execute commands try
system(commandhere);
example:

int main()
{
system("ping nsa.gov"Wink;
}

enjoy


Author

RE: C++ code to wright a bat file


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 17-09-06 22:26
read my tutorial on c++ system commands