• Log in or sign up for an account here: https://www.sythe.org/login

The basics of Batch.

EatSleepOwn

Member
Joined
Jul 25, 2008
Sythe Gold
0
Messages
53
Age
36
Location
3737 club estates drive, APT 1. Muskogee, Oklahoma. Come rape me.
Alright, today I will be showing you how to do a couple of fun things, using Batch.

EDIT: Here is a video I made about Batch:
http://youtube.com/watch?v=oP_bn0MZ1vQ

First, I will tell you a little about Batch.

I describe Batch as simply as this. Say you always have three programs you start up at once. For instance, mIRC, Windows Live Messenger, and Firefox. Rather than finding the programs on their own, You can use a Batch file to start them simultaneously.

Of course, their are other things you can do with Batch, The above is just one example of the things you can do.


Now, to begin writing Batch, you will need the following things.
  1. A computer
  2. The Notepad program

Let's get down to writing some files.

Open up Notepad
batch1vm6.jpg


We're going to make a batch file that will open mIRC, Windows Live Messenger, And Firefox.

I will explain the commands used later, for now, type the following into notepad.


@echo off
echo This is the file that opens my favorite programs.
pause
start mirc.exe
start msnmsngr.exe
start firefox.exe
exit

batch2tx5.jpg


Now, Go to File > Save as
Now, for the file name, type something like, MyPrograms.bat
**MAKE SURE YOU INCLUDE THE .bat**

Now, below the file name box, you will see save as Type: Click all files.

batch3zz1.jpg


Now, just simply double click the file, and those three programs will be launched.

Now, to explain what we did in that file.

@echo off
That means it tells the file not to display messages, like errors and such.

echo
Makes the file display the message you typed.

pause
Tells the file to stop until you hit a button.

start
Tells the file to start the program.

exit
Exits the batch file.


Now, let's learn some fun things you can do with batch.

Note: This only works on computers with a shared network, I.E. A school.

Start the command prompt.
batch4oq2.jpg


now, type in
ddeshare.exe
batch5gw0.jpg


Go to File > Select computer


This screen will pop up:
batch6le7.jpg


select the workgroup, If it's the library's computers, It would be something like MHSLIB246.

Find the computer you want, the click it once, its name will show up in the field, You can highlight it, then hit cntrl+C
Exit out of the ddeshare.exe window, until you are back at the command prompt. Now, type
Net send Paste the name of the computer here Type the message you want to send to them after the computer name:
batch7ev3.jpg



If you did everything correctly, a message will pop up on their screen. This is great for talking to each other in class, When there is no talking.



Thanks for reading my guide, and expect some more to come your way!
 
Start is not required to start a program. If the executable exists in the System32 directory, or any other directory in your PATH variable, it will start by simply entering the file name.

"Exit" is superfluous; The batch file will always exit on its own, unless you are running an interactive application through the command line, in which case, exit wouldn't even be executed.

Net send is disabled by default on SP2+.

ddeshare isn't even a part of batch, why are you covering it?
 
<3 n4n0
Discord Verified
Two Factor Authentication User
Community Participant
Spam Forum Participant
Sythe's 10th Anniversary
Sythe Awards 2011 Winner
Ummmmm, you jumped around too much... o.O


and you only covered starting programs...
 
looks okay but i need a dummy's guide maby right that one next ?:D
 
nice guide but im horrible at this stuff..
 
Runescape Gamblingrunescape gambling
Back
Top