|
-
Nov 15th, 2001, 10:44 AM
#1
Thread Starter
Fanatic Member
How do Batch files really work
Really.. How do they work.. ?
as well can someone shed some light on the other obscure file extensions... ini .. etc..
Seahag
-
Nov 15th, 2001, 10:48 AM
#2
Batch files, essentially, run a series of DOS commands for you so that you don't have to enter each command individually.
InI files are pretty much old school, although some folks still use them. They are text files that store application specific information.
-
Nov 15th, 2001, 10:48 AM
#3
Frenzied Member
A batch file is really just a list of DOS commands that execute in the order they are contained in the file.
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Nov 15th, 2001, 10:48 AM
#4
Frenzied Member
Hack has quicker fingers!
seoptimizer2001
VB 6.0, VC++, VI, ASP, JavaScript, HTML,
Perl, XML, SQL Server 2000
If God had intended us to drink beer, He would have given us stomachs.
Please use the [code] and [vbcode] tags in your posts!
If you don't know how to use them please go HERE!

-
Nov 15th, 2001, 10:54 AM
#5
Thread Starter
Fanatic Member
Yes he does..How do the run.. are they like executibles?
-
Nov 15th, 2001, 10:57 AM
#6
Hyperactive Member
-
Nov 15th, 2001, 10:58 AM
#7
Thread Starter
Fanatic Member
K.. confused
Do you use notepad?..
-
Nov 15th, 2001, 11:01 AM
#8
Hyperactive Member
-
Nov 15th, 2001, 11:01 AM
#9
they are not executables. The OS just reads the text file and executes each line in it.
yes youcan use notepad or any text editor.
-
Nov 15th, 2001, 11:07 AM
#10
Thread Starter
Fanatic Member
now really confused.
I created a new notpad file.. named it test.bat.
Then put calc.exe in it.... saved it
now I click on it and the only thing that happens is notpad opens
arggggg...
-
Nov 15th, 2001, 11:10 AM
#11
You aren't going to be able to run a batch file from windows, and you aren't going to be able to start a windows program from a batch file.
Batch files run at the DOS prompt. If you want to run Calc.Exe from a program, it would have to be a windows program that you wrote.
-
Nov 15th, 2001, 11:12 AM
#12
thats incorrect hack. putting calc in the bat file will run windows calculator when you run the bat file.
-
Nov 15th, 2001, 11:13 AM
#13
Thread Starter
Fanatic Member
Ok.. where do i run the Batch file?
-
Nov 15th, 2001, 11:15 AM
#14
just run it like you would anything else...double click on the bat file in explorer or run it in a Dos window..or use the Run on the Start menu
-
Nov 15th, 2001, 11:15 AM
#15
Holy Tamales Candor, I had no idea. I just did it (thinking, pooh and pooh...this isn't going to work), and lo and behold, up pops the calculator right smack dab in the middle of a DOS window. I'm not exactly sure what I'll ever do with this new found information, but it is interesting!
-
Nov 15th, 2001, 11:20 AM
#16
Thread Starter
Fanatic Member
Notepad just opens??
What am I missing>?
-
Nov 15th, 2001, 11:21 AM
#17
did you give the file an extension of .bat or do you still have extension as .txt
-
Nov 15th, 2001, 11:23 AM
#18
Thread Starter
Fanatic Member
I named it test.bat
but i went to look at it. It still has the test.bat.txt
How do I change that?
-
Nov 15th, 2001, 11:24 AM
#19
right click...choos rename then take out the .txt
-
Nov 15th, 2001, 11:25 AM
#20
Black Cat
Note that batch files do not necessarily contain DOS, just commands for the windows shell (which used to be DOS, but isn't anymore). There is a syntax to them - they're not unlike *nix shell scripts.
Make a batch file with:
call it p.bat
Then at a command prompt (cd to folder with p.bat in it):
Type: p 127.0.0.1
And see what happens.
(PS - I think SeaHag is saving with the wrong file extension. *.bat.txt)
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Nov 15th, 2001, 11:26 AM
#21
Thread Starter
Fanatic Member
Thanks.. 
Really not that hard.. (duh)
What about the path.. where does it look for stuff.
do you have to include a path string?
-
Nov 15th, 2001, 11:30 AM
#22
you would do it like you would in a dos window.
for example here would be the lines of a bat file to change to the c:\hello\bye directory
c:
cd hello\bye
-
Nov 15th, 2001, 11:34 AM
#23
Thread Starter
Fanatic Member
Strange..
why can i just do calc.exe.. (i know that it is in the windows dir ?)
This is becomming very clear though.
how adaptible is scripthing to batch files...
What eles can you do with batch files?
That is all
Thanks everyone !!!
-
Nov 15th, 2001, 11:38 AM
#24
because calc is in the windows default path so it knows where to look already.
You cannot script inside a bat file(although technically a bat file is scripting), you could use a bat file to run a vbs script file if you wish....the same way you run an exe.
If you have it is your mind that you can program an application with a bat file, you need to scrap that idea...all it does is run dos command lines.
-
Nov 15th, 2001, 11:40 AM
#25
Thread Starter
Fanatic Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|