Help with system command

Hi, I'm trying to test my skills by making a dos script to mess with my friends, but its not working. Here is my code:

First attempt:
http://pastebin.com/3jiwseXd

Second attempt:
http://pastebin.com/430KzXbY


How would you make it work, and what is wrong. is there a way to incorporate a variable into a system command? help me.
attack.c_str() but why not just use a batch script and then use a batch script to exe convertor?
Because I don't think there can be loops in a batch script and thank you.
ur lack of creativity is showing:

1
2
3
4
:a
if condition is met :b
goto :a
:b
ok, now i used the code:

#include <iostream>
#include <conio.h>
#include <ctype.h>
#include <string>
using namespace std;

void main(){
string IP;
cout << "What ip do you want to attack?" << endl;
cin >> IP;
string attack = "ping" + IP;
while(7==1){
string attack;
attack = "ping" + IP;
system(attack.c_str());
system("pause");

}

}


and it closes after i type the ip. the output is:


'ConsoleApplication1.exe' (Win32): Loaded 'C:\Users\user\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe'. Symbols loaded.
'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp110d.dll'. Symbols loaded.
'ConsoleApplication1.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr110d.dll'. Symbols loaded.
The program '[6900] ConsoleApplication1.exe' has exited with code 0 (0x0).

well why do u have conio and ctype and no cstdlib? and why cant u do this in a batch script now? and it needs to be "ping " because if i input 176.434.435.43 it will be ping176.434.435.43
and why you're doing:

 
while (7 == 1)


that's false...

and ping is very outdated DOS attack... you're not gonna to attack any (good) websites...
but the reason i even made this thread was to see if we can incorporate a user inputted variable into a system command, not make an actual dossing program, that was just to boot my friend off of his WiFi for a few minutes.
Topic archived. No new replies allowed.