topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Monday November 4, 2024, 3:00 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Need help regarding DOS and BAT files.  (Read 14396 times)

hulkbuster

  • Participant
  • Joined in 2009
  • *
  • Posts: 259
    • View Profile
    • Donate to Member
Need help regarding DOS and BAT files.
« on: April 14, 2010, 05:29 PM »

Hello folks, i need some advise. u see i really want to learn more about making Batch file n DOS. Although i had some training in DOS in my formative years; but  that was only basics.
         I serched through web and couldn't find any decent materials, only some examples. Although making BAT file to run some appli isn't new or hard for me. Its because i want to advance to learn C++ (i did learn C++, but it was on unusual time, back then i wasn't interested and uncooperative with teachers). I heard that making/learning BATCH file is the basic to learn any programming language.
          Could someone help me here regarding my query i.e.,( understanding ONLY BATCH FILE AND DOS). Any suggestion welcomed.

Many regards. :D
ClipDiary 5.3/ Smadav 2018/ Some Sense

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #1 on: April 14, 2010, 05:44 PM »
As good a place to start as any:

http://www.microsoft...ntcmds.mspx?mfr=true


For easy to learn scripting language try AutoIt3.  It's free and has a simple syntax.
http://www.autoitscr.../autoit3/index.shtml


f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #2 on: April 14, 2010, 05:44 PM »
I heard that making/learning BATCH file is the basic to learn any programming language.
:o :o :o

I wouldn't advise anyone to mess with batch files to learn programming. It's very limited in functionality, you have to work around instead of with the language to get things done, and it's not easy to structure things for easy readability.

If you want to start with a scripting language, something like Python would be a much better choice. And for an OOP language, I'd suggest Java (yes, Java and not C++... C++ is a big mouthful and it's easy to get lost in language technicalities instead of actually learning programming). C# is also pretty nice, but I'd consider Java easier "getting into".
- carpe noctem

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #3 on: April 15, 2010, 10:58 AM »
Although I don't really call myself a programmer, I do tend to have pretty strong opinions on programmery things. :o

1. I share f0dder's skepticism that batch is a gateway language to C++ and also his statement that "you have to work around instead of with the language to get things done." However, I think it is still worth learning batch in itself, it is becoming kind of a lost art and there is still value in it as a Windows user. No comment on Java.

2. I have a few links related to creating advanced batch files.

<a href="http://www.macaleste...nes/batch_tricks.htm">Timo Salmi's Assorted Batch Tricks</a>
<a href="http://www.commandline.co.uk/">Ritchie Lawrence's Batch Function Library</a>
<a href="http://hfslip.org/">HFSlip - a complete slipstreaming tool for Windows 2000/XP written as a 30+ page batch file</a>

3. I agree with MilesAhead's recommendation of AutoIt3 for a nice scripting, get-things-done type language, especially in conjunction with Scite4Autoit3 and the Koda Form Designer. Autoit3 is much like Autohotkey, with a little more humane syntax, I think. The help file is very good too, every function has a nice short example.
« Last Edit: April 15, 2010, 11:01 AM by daddydave »

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #4 on: April 15, 2010, 03:24 PM »
More useful batch stuff here: Getting started with batch files

f0dder's right about having to work around batch file limitations.  In which case, don't overlook Horst Schaeffer's Batch tools & utilities for the MS-DOS operating system, where you can many word-around aids.

3of0

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 32
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #5 on: April 15, 2010, 03:43 PM »
I don't consider myself a programmer either (yet), I'm with f00der & daddydave.  They've already said what I would say.  Batch scripting is still useful, but I wouldn't suggest it for anything big.  And I'd agree with trying Python or Java first.

How to Teach Yourself Programming - Teach yourself C++ in 21 days.
Teach Yourself Programming in Ten Years - From the bottom of the comic.  Kind of long, but interesting read.

If you've already learned some C++, you might try finding some online tutorials and see how much you do remember.  You might not want/need to jumpstart yourself with other languages.
« Last Edit: April 15, 2010, 03:45 PM by 3of0 »

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,505
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #6 on: April 15, 2010, 05:58 PM »
it's easy to get lost in language technicalities instead of actually learning programming
Yep, with Java it is easier to "learn programming". There is a library for everything, so basically it is just C&P.
Sooo much better than C++ where you actually have to understand how to code.

(Sarcasm, anyone?)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #7 on: April 15, 2010, 06:14 PM »
I think you completely missed the point, Tuxman.

Language technicalities != libraries. Anybody who has had to deal with template errors, code behaving inconsistently because of subtle language rules allowing aggressive optimizations, implicit conversions you didn't expect, et cetera(!) would probably agree with me that C++ isn't the best language to start with. Java is just a lot friendlier in that regard.

"There is a library for everything, so basically it is just C&P." is bullshit, and using existing libraries doesn't mean you aren't going to understand what you're doing. When is the last time you wrote your own memory manager, anyway?
- carpe noctem

Tuxman

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,505
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #8 on: April 15, 2010, 06:23 PM »
I never had to.

C++ might have some difficulties Java does not have; but it all depends on how you are going to work later. Most Java "programmers" don't actually program, they only complete already existing code bases. See, it is also a question of idealism. To me, people who let their IDE generate the boilerplates are, maybe, "developers", but programming is something quite different.

Sure, getting into the finesses is harder in C++. But once you understood why something does what, you are able to work with it. That's what it is all about, right?

If hulkbuster wants to learn how to be a programmer, IDE-driven languages like Java are not the way to go IMO.
(Yep, sure, all Java programmers on DC code with pure Notepad and cmd. Well then. ;-))

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #9 on: April 18, 2010, 11:27 AM »
I serched through web and couldn't find any decent materials

One of the books I found useful was one by Dan Gookin, Advanced MS-DOS Batch File Programming.  You could try Advanced Book Exchange (ABE) to look for a copy.  Gookin intends to put his old stuff online: that hasn't happened yet, but he's made some of the companion disks freely available on his Wambooli Archives site.

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #10 on: April 18, 2010, 10:52 PM »
If you want to start with a scripting language, something like Python would be a much better choice.


tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #11 on: April 18, 2010, 10:55 PM »
This is one of the better ones. There are others. But IMNSHO, you are better off starting with Python.

hulkbuster

  • Participant
  • Joined in 2009
  • *
  • Posts: 259
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #12 on: May 03, 2010, 03:47 PM »
Thank u all for ur valuable inputs, lately i was busy with other things.
Now i can browse through these links and see where i'll get. This is the first place i got any real material/understanding about  FIRST PLACE FOR BATCH and another SECOND PLACE.
Guess i'll h' to do a lot of headscratching with Python too  :D
Thank u :Thmbsup:: MilesAhead ,daddydave ,rjbull ,3of0 ,and tinjaw , u all were of great help. :beerchug:

I havn't  gone thru all of them , but i'll do from now (...period) tinjaw h' u reached anywhere with Python, did u find it easy, just checking...

MANY THANKS: :)
ClipDiary 5.3/ Smadav 2018/ Some Sense

tinjaw

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,927
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #13 on: May 06, 2010, 08:30 AM »
tinjaw h' u reached anywhere with Python, did u find it easy, just checking...

Yes, I love Python and use it every day in my day job and every night for fun.

widgewunner

  • Member
  • Joined in 2009
  • **
  • Posts: 93
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #14 on: May 07, 2010, 05:11 PM »
I would recommend first learning basic C syntax. Start with the classic K&R book (It is short and gets straight to the point):

C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie

Its not cheap but its worth every penny. C is the foundation of many popular languages: (C++, PHP, Java, Javascript and more). ANSI C hasn't changed a bit in 22 years.

hulkbuster

  • Participant
  • Joined in 2009
  • *
  • Posts: 259
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #15 on: May 11, 2010, 02:56 AM »
I would recommend first learning basic C syntax. Start with the classic K&R book (It is short and gets straight to the point):

C Programming Language (2nd Edition) by Brian W. Kernighan and Dennis M. Ritchie

Its not cheap but its worth every penny. C is the foundation of many popular languages: (C++, PHP, Java, Javascript and more). ANSI C hasn't changed a bit in 22 years.

-widgewunner (May 07, 2010, 05:11 PM)
Hello widgewunner i had learnt a bit of C language in my formative years: i can remember doing this
#include:
io stream.h
can't recall much and can't recall the Program we used to Practice , can u suggest any program for using specifically C language only :
i know learning c language wont be too much of a head banging.

Many thanks:
ClipDiary 5.3/ Smadav 2018/ Some Sense
« Last Edit: May 11, 2010, 02:59 AM by hulkbuster »

widgewunner

  • Member
  • Joined in 2009
  • **
  • Posts: 93
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #16 on: May 11, 2010, 08:29 PM »
The C compiler I use is not free (I use MS Visual c++ 6.0). You can get a free version from MS (the "express" version) but from my limited trial with that version I found it to be pretty bloated and crippled. There is also a free version of of the older Borland C compiler but I don't have any experience with that version.

What I would do is get and read the K&R book and start playing around with PHP. Its free, very C like, and has a lot of nice additional features on top of it. The documentation is great too. And PHP is a very handy technology to know if you plan on doing anything web related.
:)

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #17 on: May 12, 2010, 06:04 AM »
The C compiler I use is not free (I use MS Visual c++ 6.0). You can get a free version from MS (the "express" version) but from my limited trial with that version I found it to be pretty bloated and crippled.
-widgewunner (May 11, 2010, 08:29 PM)
Crippled in what way? Funny that you say you use VC6 and call the express editions crippled, considering the amount of bugs and level of C++ compliance in VC6 :p
- carpe noctem

widgewunner

  • Member
  • Joined in 2009
  • **
  • Posts: 93
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #18 on: May 12, 2010, 11:30 PM »
By "crippled" I meant it had reduced/hobbled functionality. As I recall, the 2005 Express edition did not allow compiling a full fledged GUI app, only a command line console app. Can't say if the newer "Express" version has these sorts of limitations...

daddydave

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 867
  • test
    • View Profile
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #19 on: May 13, 2010, 04:39 AM »
By "crippled" I meant it had reduced/hobbled functionality. As I recall, the 2005 Express edition did not allow compiling a full fledged GUI app, only a command line console app. Can't say if the newer "Express" version has these sorts of limitations...
-widgewunner (May 12, 2010, 11:30 PM)

I've played around with both 2005 and 2008 versions of Visual C++ and both alllowed compiling GUI apps. My recollection is this. With 2005, you had to do some extra work to be able to complile non-dotnet apps, but once you did, you were set. In 2008, it was built in. Can't say for 2010. One limitation I did notice is that the Express 2008 version didn't let you compile Windows Mobile apps.

f0dder

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
  • [Well, THAT escalated quickly!]
    • View Profile
    • f0dder's place
    • Read more about this member.
    • Donate to Member
Re: Need help regarding DOS and BAT files.
« Reply #20 on: May 13, 2010, 05:07 AM »
With 2005, you had to do some extra work to be able to complile non-dotnet apps, but once you did, you were set.
IIRC, it was just the PlatformSDK that wasn't included with 2005 express, so yeah - just download that, and you were set.

There's a few things about Express that could be show-stoppers for some:
1) they don't include MFC.
2) they don't include the resource editor.
3) some of the advanced functionality from the pro versions are missing, but it's stuff most won't miss.

I don't see #1 as a problem, unless you have to deal with legacy codebases using MFC. #2 is a bit more of a "real" problem, but there's 3rd party resource editors around. And if you need the stuff from #3, you're probably doing professional development and then it's sorta fair you pay for the suite :)
- carpe noctem