PDA

View Full Version : batch file in CMD Prompt



22b
04-22-2003, 05:33 PM
I am trying to mess with a buddy at work (very bored!)
lets say I have something on notepad that I want to re-send over and over through netsend in CMD PROMPT.

Once I save this .txt file - how do I run it over and over in CMD PROMT?

Any help is appreciated!

CCW
04-23-2003, 03:22 AM
just the text or the whole file?

CCW
04-23-2003, 03:26 AM
used the call command for the whole file, just use it over and over to re-cal lthe .txt file

wdd1040
04-23-2003, 03:36 AM
simple... rename the text file as let's say 1.bat
at the last line of the batchfile, put 1.bat

for instance, I'm at school and someone at the computer with the name of rm133-01 is messing with me.
I open notepad and type

net send rm133-01 leave me alone (or other similar phrases)
1.bat

then I click save and save it as 1.bat on the desktop. double click 1.bat and it will start to loop in a dos window.:D
Wes

22b
04-23-2003, 07:34 AM
okay I saved a txt file called 1.bat on my desktop. I txt files has a nice message listed followed by 1.bat on the last line.

I go to CMD PROMPT and type
c:/ net send 192.168.1.100 1.bat

then click enter to send the mssg
and then double click the bat file on desk top?

I runs a loop on my desktop, not his?

What am I doing wrong?

wdd1040
04-23-2003, 07:54 AM
ok ok, I think you misunderstood me.
the batchfile contains all the commands and everything so put the message you want to send him in the command in there.
So if you wanted it to say hi put all of the following in the batch file.


net send [computername] hi
1.bat



Then you execute the batchfile and it does the commands for you. you can change out hi and put whatever you want.


EDIT*** You don't even need to do anything at the CMD prompt. put everything in the batch and then just double click it. First thing is that you need to find out his computer name. You might be able to corrolate his IP to his computername by looking at the active directory on your computer, or by using ARP. Maybe even NSLOOKUP. I haven't ever really had to do that because at my school everything comes through with computer name almost identical to the IP. Then again, at my school every computer has a user name of Administrator with the password of Password which just makes it simple to mess with people. :D

CCW
04-23-2003, 09:26 AM
Originally posted by wdd1040
Then again, at my school every computer has a user name of Administrator with the password of Password which just makes it simple to mess with people. :D [/B]

lol, system admins, u gotta love em!

Smizack
04-23-2003, 03:45 PM
Originally posted by CCW
lol, system admins, u gotta love em!


No kidding...:rolleyes:

Charles Wirth
04-23-2003, 04:02 PM
Just went over this in another thread

edit hi.bat

net send 23.45.56.78 Hi
call hi.bat

The hi.bat file will run over and over untill the machine on the other side runs out of memory and crashes from too many dialog boxes on the screen.

CCW
04-24-2003, 01:35 AM
lol, will try this when my step-dad is winning in a game of C&C: generals, that that he ever does win or anything :hehe:

wdd1040
04-24-2003, 02:57 AM
Originally posted by FUGGER
Just went over this in another thread

edit hi.bat

net send 23.45.56.78 Hi
call hi.bat

The hi.bat file will run over and over untill the machine on the other side runs out of memory and crashes from too many dialog boxes on the screen.
why do you have to use call? I have never used call in anything like that and it's worked fine as long as I execute it in the same dir? enlighten me.:)
Wes

Charles Wirth
04-24-2003, 07:15 AM
Call will run the program again, an infinite loop.

wdd1040
04-24-2003, 07:35 AM
well, that's a given, but if you leave the call command out it will still cause an infinite loop. My question was, are there any other implications that the call command can be used and upon its necessity in this circumstance.

Charles Wirth
04-24-2003, 08:30 AM
Same functionality I guess. /shrug

wdd1040
04-24-2003, 09:39 AM
kewl, much thanks.:toast: