Batch Files

Ian

Administrator
Joined
Oct 17, 2008
Messages
3,484
Reaction score
632
Does anyone here still create and use batch files (.bat files for the command line)?

I've been refreshing my memory today on how to use some of the more advanced features, as I had a need to create a little application which would have taken quite a bit of time to code in VB. As it turns out, getting a batch file to read variables from INI files and perform loops is really easy - it just took a little reading up. :) I'm always surprised at how handy batch files can be, even now it's been 15 years since most people took a look at DOS (or the command line).

Sometimes I'm such a geek :lol:
 
Joined
Mar 8, 2009
Messages
5,063
Reaction score
1,185
I've not created .bat files for sometime now. With the coming of Windows XP the .bat files became extinct in my opinion. After finding out that XP gave better commands that were not available to previous OS's and that they renamed the extension. The extension is known as .cmd which is basically an advanced .bat file. I started using the .cmd extension instead of the .bat.
 

Ian

Administrator
Joined
Oct 17, 2008
Messages
3,484
Reaction score
632
I always thought .cmd and .bat files were the same thing (although, I'm just being old fashioned by using the old convention)? Perhaps I should get a little more up to date and rename them :).
 
Joined
Mar 8, 2009
Messages
5,063
Reaction score
1,185
They are the same Ian with the exception that XP allows for greater possibilities that were not available to previous OS's. The name was changed so that the new commands would not be mistakenly executed on the older OS's. The new commands could be programmed in the bat files but if renamed to cmd the older OS's would not see it as an executable.
 
  • Like
Reactions: Ian

Core

all ball, no chain
Moderator
Joined
Feb 13, 2009
Messages
1,175
Reaction score
272
I haven't really used batch files much since Win95. When I still used Win 3.11, I used batch files all the time. I absolutely loved working in the command prompt. But at some point when Windows went 32-bit and apps that could do backups and file management well started coming around, the command prompt under Windows just began to feel horribly toothless. Now what with PowerShell being available, I can see it as being more useful again, but I haven't really looked into it. I still like console access, but I like it better in Linux where I feel like I'm in charge, and not the system.
 

Ian

Administrator
Joined
Oct 17, 2008
Messages
3,484
Reaction score
632
Thanks for the heads up Clifford, I see what you mean now as .cmd files won't execute on pre-XP systems - hence a way to separate the new features even if .bat files would still run.

Now what with PowerShell being available, I can see it as being more useful again, but I haven't really looked into it. I still like console access, but I like it better in Linux where I feel like I'm in charge, and not the system.
PowerShell 2.0 is pretty useful, but I haven't explored it properly yet. Command-line access is so handy for many things once you are used to it. :)
 

Kougar

OCing one chip at a time
Joined
May 11, 2009
Messages
588
Reaction score
116
Hmm, but they modified the commands in Windows Vista/7 batch files if I recall correctly?

I'll confess my batch file experience is limited, but I do use them to conduct some advanced benchmarking scenarios. The list of advanced/unkown/OS specific commands that can be added to a Windows 7 batch file is rather long, but as Clifford says the commands won't be recognized in an older OS like XP. In fact what I was reading almost made it seem like today's batch file is nothing like the DOS version it started as... I don't recall the link offand, but there were plenty out there when I was reading up on making my own. :)
 
Joined
Feb 17, 2010
Messages
158
Reaction score
25
I used to use them. I took a few programming classes in college though, and you can write a program in c that does a thousand times more then a .bat script, and it doesn't take too long to code and compile a simple program. Just like Core said " I like it better in Linux where I feel like I'm in charge, and not the system." I like writing scripts in Linux better too, bash may scare allot of people off but not me :D
 
Last edited:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top