Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Nov 10th, 2006, 12:08 PM   #1
Samuaijack
Programmer
 
Samuaijack's Avatar
 
Join Date: Jul 2006
Location: using Earth.Africa.Egypt.Cairo;
Posts: 76
Rep Power: 3 Samuaijack is on a distinguished road
Batch Programming

hey guys,
I've always wandered about the use of batch programming,i know that they are Dos Commands in a text file saved as a .bat file,but what is the use of such files,and does any one use those now days???
Samuaijack is offline   Reply With Quote
Old Nov 10th, 2006, 12:27 PM   #2
MBirchmeier
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 211
Rep Power: 3 MBirchmeier is on a distinguished road
Quote:
Originally Posted by Samuaijack View Post
hey guys,
I've always wandered about the use of batch programming,i know that they are Dos Commands in a text file saved as a .bat file,but what is the use of such files,and does any one use those now days???
That's pretty much all it is yes, it's simply just a bunch of dos/shell commands back to back.

There's reasons for it, but generally for more complex stuff I try to use perl or something similar. Here's a list of some things I've made batch files for in the past:

* I had to copy files from my computer to a test server rather regularly, but not all of them, only certain types, I created a batch file to copy these for me.
* I often use remote/logical drives for different projects just to keep things easier, I'll often use batch files to set up the drives the way I want for a certain project (as I switch projects a bit)
* I had one project where a file on a remote device needed to stay 'release' but often needed to be switched to 'debug' for debugging, I created a script to re-name the files appropriately when debugging with one click, and back again.

Hope this helps...

-MBirchmeier
MBirchmeier is offline   Reply With Quote
Old Nov 10th, 2006, 1:02 PM   #3
Samuaijack
Programmer
 
Samuaijack's Avatar
 
Join Date: Jul 2006
Location: using Earth.Africa.Egypt.Cairo;
Posts: 76
Rep Power: 3 Samuaijack is on a distinguished road
ya that helped MBirchmeier thnx
Samuaijack is offline   Reply With Quote
Old Nov 10th, 2006, 3:05 PM   #4
AntiNinja
Hobbyist Programmer
 
AntiNinja's Avatar
 
Join Date: Jun 2006
Location: The States
Posts: 101
Rep Power: 3 AntiNinja is on a distinguished road
Send a message via AIM to AntiNinja Send a message via Yahoo to AntiNinja
I use them almost daily, I primarily use them to launch my games in high priority without having to use the Task Manager. Or you can use them to delete certain files, batch rename, etc., the list goes on and on. Although it is very limiting.

I think every 'programmer' should have knowledge of how to use them, its so easy to create/use and quite useful/time saving.
__________________
Pain is just weakness leaving the body.
AntiNinja is offline   Reply With Quote
Old Nov 10th, 2006, 4:39 PM   #5
Samuaijack
Programmer
 
Samuaijack's Avatar
 
Join Date: Jul 2006
Location: using Earth.Africa.Egypt.Cairo;
Posts: 76
Rep Power: 3 Samuaijack is on a distinguished road
thnx AntiNinja,
i think i'll start learnig it.
Samuaijack is offline   Reply With Quote
Old Nov 11th, 2006, 6:38 AM   #6
lectricpharaoh
Caffeinated Neural Net
 
lectricpharaoh's Avatar
 
Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,031
Rep Power: 5 lectricpharaoh will become famous soon enough
One thing I use them for regularly is copying directory trees at school. Many instructors put material on the college server, and it's a pain in the ass to point-and-click navigate to the right folder, and copy it over in the GUI. It's much easier to have a batch file on my USB drive, and double-click it.

Another thing it's useful for, particularly if you have a mobile computer that connects to different networks based on location, is mapping network drives. It's much easier to double-click the batch file/shortcut thereto than it is to type some lengthy NET USE command, or navigate the many clicks and keystrokes needed to map the drive in Explorer (I am assuming the share requires a password). Yes, sometimes you can set it up to automagically connect, but occassionally, this isn't appropriate (such as when you don't want to always be connected).

Lastly, they're useful for utilities that use a command-line interface. You can write a batch file to repetitively call the utility for each instance of the task (say, each file you want to process), without having to tediously type everything out.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot.
- Vaarsuvius, Order of the Stick
lectricpharaoh is offline   Reply With Quote
Old Nov 11th, 2006, 6:49 AM   #7
dr.p
Programmer
 
dr.p's Avatar
 
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3 dr.p is on a distinguished road
I use them every day. Mine are primarily for programming environment initialization, because I do most everything from the command line. I have scripts that set all my environment variables; others that have all my compile/build functionality. Then there are the quick-launch scripts that I execute via the "Run" dialog, so that I don't have to move from the keyboard to the mouse to start certain programs.
__________________
Neeley.org
dr.p is offline   Reply With Quote
Old Nov 11th, 2006, 11:33 AM   #8
Samuaijack
Programmer
 
Samuaijack's Avatar
 
Join Date: Jul 2006
Location: using Earth.Africa.Egypt.Cairo;
Posts: 76
Rep Power: 3 Samuaijack is on a distinguished road
thnx guys that was lots of usefull info.
Samuaijack is offline   Reply With Quote
Old Nov 11th, 2006, 12:15 PM   #9
Iftikhar
Programmer
 
Iftikhar's Avatar
 
Join Date: Oct 2006
Location: London
Posts: 40
Rep Power: 0 Iftikhar is on a distinguished road
Send a message via MSN to Iftikhar
You can learn more advance batch programming from the following URL address http://www.osix.net/modules/article/?id=755
__________________
Iftikhar Ahmed Khan
For doing an experiment on programmer's mood please visit http://uxisfyp1.brunel.ac.uk/cspgiak
Iftikhar is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming without post secondary education Eric the Red Other Programming Languages 6 Mar 7th, 2006 5:56 PM
Does Programming Make You Smarter? Sane Coder's Corner Lounge 43 Oct 2nd, 2005 6:12 AM
MIT's Metaphor For Software Programming Infinite Recursion Other Programming Languages 2 Jun 12th, 2005 6:42 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:07 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC