Windows 7 Forums


Reply
Thread Tools

Batch Files

 
 
Ian Ian is offline
Administrator
Ian's Avatar
Join Date: Oct 2008
Location: England
Posts: 3,090
Thanked: 450
Ian's Twitter Pag
 
      02-13-2010
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
 
Reply With Quote
 
 
 
 
clifford_cooley clifford_cooley is offline
(c_c)
clifford_cooley's Avatar
Join Date: Mar 2009
Location: Arkansas, USA
Posts: 4,441
Thanked: 924
 
      02-13-2010
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.
 
Reply With Quote
 
Ian Ian is offline
Administrator
Ian's Avatar
Join Date: Oct 2008
Location: England
Posts: 3,090
Thanked: 450
Ian's Twitter Pag
 
      02-14-2010
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 .
 
Reply With Quote
 
clifford_cooley clifford_cooley is offline
(c_c)
clifford_cooley's Avatar
Join Date: Mar 2009
Location: Arkansas, USA
Posts: 4,441
Thanked: 924
 
      02-14-2010
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.
 
Reply With Quote
 
Core Core is offline
throwing darts
Core's Avatar
Join Date: Feb 2009
Location: Akaa, Finland
Posts: 815
Thanked: 172
Send a message via MSN to Core Send a message via Yahoo to Core Send a message via Skype™ to Core Core's Twitter Pag
 
      02-14-2010
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.
 
Reply With Quote
 
Ian Ian is offline
Administrator
Ian's Avatar
Join Date: Oct 2008
Location: England
Posts: 3,090
Thanked: 450
Ian's Twitter Pag
 
      02-14-2010
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.

Quote:
Originally Posted by Core View Post
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.
 
Reply With Quote
 
Kougar Kougar is offline
OCing one chip at a time
Kougar's Avatar
Join Date: May 2009
Location: Texas
Posts: 527
Thanked: 94
 
      02-14-2010
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.
 
Reply With Quote
 
linuxdudex12 linuxdudex12 is offline
Established Member
linuxdudex12's Avatar
Join Date: Feb 2010
Location: /dev/null
Posts: 158
Thanked: 19
 
      02-21-2010
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

Last edited by linuxdudex12; 02-21-2010 at 03:31 AM..
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot restore Old XP .DAT files on my Windows 7. I used 'files and settings wizard' luwike Windows 7 Support 15 10-05-2011 11:42 PM
Windows 7 CMD Help & Tips Fire cat Customization 15 12-08-2010 06:39 AM
Files missing but appear on Search? carn1x Windows 7 Support 1 07-07-2010 10:23 AM
Script (Batch File) Writing... Elmer BeFuddled General Discussion 13 06-28-2010 12:47 AM
Get full admin in windows 7 LeHaM General Discussion 6 04-12-2010 09:03 PM


All times are GMT +1. The time now is 10:59 PM.
W7Forums is an independent website and is not affiliated with Microsoft Corporation.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33