943,965 Members | Top Members by Rank

Ad:
Sep 7th, 2005
0

Question about DOS Batch Files

Expand Post »
I'm a newbie at writing DOS batch files. I've tried to look for it, but I can't seem to figure out how to read from an input file. Is there an equivalent of a cin statement in DOS Batch programming.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
AJ_Allmendinger is offline Offline
2 posts
since Sep 2005
Sep 9th, 2005
0

Re: Question about DOS Batch Files

Batch files are just a way of grouping together calls to programs and system commands. Everything in a batch file is just something that you can do on the command line. The power comes from being able to group together numerous calls to execute a series of steps. If you are creative in how you use the tools that you have access to, you can create some seemingly intelligent behavior.

I have a feeling that you may be expecting too much out of batch files, but it could be possible to do what you want. What exactly is it that you want to do?
Reputation Points: 38
Solved Threads: 25
Posting Shark
chrisbliss18 is offline Offline
902 posts
since Aug 2005
Sep 9th, 2005
0

Re: Question about DOS Batch Files

You're right, I was expecting too much... I worked around it by having the autoexec.bat call a C++ program that served as a batch file except with more functionality.

Thanks....
AJ
Reputation Points: 10
Solved Threads: 0
Newbie Poster
AJ_Allmendinger is offline Offline
2 posts
since Sep 2005
Sep 10th, 2005
0

Re: Question about DOS Batch Files

What you might want to do is install something like Python or Ruby and write your scripts in that.
No need for compilers.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Oct 4th, 2005
0

Re: Question about DOS Batch Files

Compiled languages seem to be fading. :p
Yeah I heard ruby was good too tho.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
The_Inferno is offline Offline
10 posts
since Sep 2005
Oct 8th, 2005
0

Re: Question about DOS Batch Files

Quote originally posted by AJ_Allmendinger ...
I'm a newbie at writing DOS batch files. I've tried to look for it, but I can't seem to figure out how to read from an input file. Is there an equivalent of a cin statement in DOS Batch programming.
Some people have figured out how to do quite a good bit of processing work via batch files: ftp://137.193.64.130/pub/
Reputation Points: 99
Solved Threads: 5
Junior Poster
Evenbit is offline Offline
140 posts
since Mar 2005
Oct 8th, 2005
0

Re: Question about DOS Batch Files

Quote originally posted by jwenting ...
What you might want to do is install something like Python or Ruby and write your scripts in that.
No need for compilers.
Or you can install AutoIt. And you can optionally compile & compress your scripts too if you don't want to force your clients to download a runtime engine.
Reputation Points: 99
Solved Threads: 5
Junior Poster
Evenbit is offline Offline
140 posts
since Mar 2005
Oct 8th, 2005
0

Re: Question about DOS Batch Files

Quote originally posted by The_Inferno ...
Compiled languages seem to be fading. :p
Yeah I heard ruby was good too tho.
No...the pendulum is swinging back the other way now. When was the last time that CPU clock speed doubled? As users continue to demand more functionality and more eye-candy multimedia, it will be up to the software to pull it off -- and that can't be done with interpreted languages and virtual machines.
Reputation Points: 99
Solved Threads: 5
Junior Poster
Evenbit is offline Offline
140 posts
since Mar 2005
Mar 21st, 2011
-2
Re: Question about DOS Batch Files
you can do simplistic read ins to a variable using
set /p var="display: "

From my experience batch is extremely limited. You can do simple things but that's about it. For example, if you've ever tried using conditionals in a for loop in batch you'd understand that inside conditionals are evaluated before the for loop executes. Your cout for batch is echo which is extremely limited in that it always returns a \n at the end of its output. There is a workaround set /p var=" " < NUL but still batch is more trouble than its worth.
Reputation Points: 4
Solved Threads: 0
Newbie Poster
Dundir is offline Offline
3 posts
since Nov 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: AIML <that> tag usage issues
Next Thread in Legacy and Other Languages Forum Timeline: how can i send a formated mail?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC