Page 1 of 1 [ 15 posts ] 

LordoftheMonkeys
Veteran
Veteran

User avatar

Joined: 15 Aug 2009
Age: 37
Gender: Male
Posts: 927
Location: A deep,dark hole in the ground

23 Feb 2010, 1:28 pm

I learned DOS batch programming from a book I got from the library yesterday. It seems like kind of a useless language. I mostly just learned it for fun. I've heard that it's sort of archaic and not used much anymore, but that it still has its uses. It seems to have several limitations, such as only being able to include one command in an if statement or a for loop, so it doesn't seem like I can do much with it without using goto. Also, it doesn't have any of the fancy stuff you find in bash, like file and string operators and here-documents. What kind of tasks can batch programming, or MS-DOS in general, be applied to?



DemonAbyss10
Veteran
Veteran

User avatar

Joined: 23 Aug 2007
Age: 37
Gender: Male
Posts: 2,492
Location: The Poconos, Pennsylvania

23 Feb 2010, 1:33 pm

its useful to know, just in case you ever have to go into the windows recovery console, and for helping to fix some problems while in safe mode.


_________________
Myers Brigg - ISTP
Socionics - ISTx
Enneagram - 6w5

Yes, I do have a DeviantArt, it is at.... http://demonabyss10.deviantart.com/


Apple_in_my_Eye
Veteran
Veteran

User avatar

Joined: 7 May 2008
Gender: Male
Posts: 4,420
Location: in my brain

23 Feb 2010, 3:11 pm

Yeah, I always wondered if DOS was intentionally crippled since you can do so much with something like BASH. IOW, maybe MS wanted to sell more automation software rather than make it too easy for users to make their own scripts.



Mocha
Butterfly
Butterfly

User avatar

Joined: 18 Oct 2009
Age: 60
Gender: Male
Posts: 12
Location: UK

23 Feb 2010, 3:22 pm

Its used by system administrators when there is a need to run the same commands to multiple network devices remotely i.e servers and workstation etc. This saves time having to logon and type the commands manually. When saying that vb scripts can do much the same thing and are far more flexible as far as application is concerned. Both have thier uses but where a simple task is required a dos batch file is usually easier to configure and implement. Its also useful for toubleshooting purposes.



StuartN
Veteran
Veteran

User avatar

Joined: 20 Jan 2010
Age: 62
Gender: Male
Posts: 1,569

24 Feb 2010, 5:00 pm

If you are ever caught on an island full of rampaging, hungry dinosaurs and the electric fences are NOT controlled by a Unix system, then for /r %%F in (*.mp3) do echo %%~pnxF is a convenient way of recursively listing all the mp3 files so that you can at least be eaten to a decent sound track.



CloudWalker
Veteran
Veteran

User avatar

Joined: 26 Mar 2009
Age: 36
Gender: Male
Posts: 711

24 Feb 2010, 11:03 pm

StuartN wrote:
If you are ever caught on an island full of rampaging, hungry dinosaurs and the electric fences are NOT controlled by a Unix system, then for /r %%F in (*.mp3) do echo %%~pnxF is a convenient way of recursively listing all the mp3 files so that you can at least be eaten to a decent sound track.


why not simply
dir *.mp3/a/s/b



pakled
Veteran
Veteran

User avatar

Joined: 12 Nov 2007
Age: 68
Gender: Male
Posts: 7,015

24 Feb 2010, 11:29 pm

lawsie am I getting old...;)
Once upon a time (PL - Pre-Linus Torvalds) DOS was pretty much the 'windows' of it's day. It was what you did things with, like having to know the pathnames to actual executable files (either by knowing them, or using the PATH statement).

There was a short period of time when MS was best known for the '640k barrier'...;) This would be about Dos 5. You had to load drivers and such in a given order to have enough space to run programs.

It still has some uses; I aced the A+ cert in the mid-90s because they still cared about DOS commands. You can still do things in it, mainly as a curiosity, but sometimes just to amaze the youngsters...;)


_________________
anahl nathrak, uth vas bethude, doth yel dyenvey...


Apple_in_my_Eye
Veteran
Veteran

User avatar

Joined: 7 May 2008
Gender: Male
Posts: 4,420
Location: in my brain

24 Feb 2010, 11:53 pm

I've had rare moments where I've needed DOS to do something. There was a weird (too long IIRC) filename that Win2k couldn't delete, so went into "DOS mode" and was able to delete it using the short filename i.e. "shortnam~1.dat"

And afterwards I went and wrote a bash script to download & save some audio streams, in order to cleanse myself of DOSs' klugyness. :wink:



scubasteve
Veteran
Veteran

User avatar

Joined: 17 Dec 2009
Gender: Male
Posts: 1,001
Location: San Francisco

26 Feb 2010, 11:03 am

They were very useful back in the '90s for all sorts of tasks, like installing and configuring software and even managing the bootloader (autoexec.bat) but at this point they're pretty much obsolete.



CloudWalker
Veteran
Veteran

User avatar

Joined: 26 Mar 2009
Age: 36
Gender: Male
Posts: 711

26 Feb 2010, 2:58 pm

Do you really mean DOS batch programming? The Windows incarnation is very different from the DOS one. You can also install PowerShell on older versions of Windows if you need a more powerful language. btw it is preinstalled on Windows 7.



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 47
Gender: Male
Posts: 1,385

27 Feb 2010, 10:36 pm

I write diagnostics for 3D hardware by an unnamed major player in that market.

Some customers insist on having diagnostics that run on DOS, because they don't want to change it unless there's a business reason, and so far there's no business reason.

Aside from that, other than UEFI, DOS has the smallest boot footprint of any PC OS in circulation.



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 77
Gender: Male
Posts: 9,798
Location: Somerset UK

28 Feb 2010, 8:58 am

MyFutureSelfnMe wrote:
...
Aside from that, other than UEFI, DOS has the smallest boot footprint of any PC OS in circulation.

Sort of a strange statement - and not at all true.

I suspect you mean that MSDOS (or variant) has the smallest boot footprint of any Intel-based PC OS that emulates MSDOS, in circulation.


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 47
Gender: Male
Posts: 1,385

28 Feb 2010, 9:56 am

lau wrote:
MyFutureSelfnMe wrote:
...
Aside from that, other than UEFI, DOS has the smallest boot footprint of any PC OS in circulation.

Sort of a strange statement - and not at all true.

I suspect you mean that MSDOS (or variant) has the smallest boot footprint of any Intel-based PC OS that emulates MSDOS, in circulation.


You are absolutely correct on the "MSDOS (or variant)" and "Intel-based" parts. I am confused about the "that emulates MSDOS" part though. There's nothing emulated about it.



MyFutureSelfnMe
Veteran
Veteran

User avatar

Joined: 26 Feb 2010
Age: 47
Gender: Male
Posts: 1,385

28 Feb 2010, 9:58 am

By the way, I think "Intel-based" is completely redundant when paired with "PC in circulation".



drybones
Deinonychus
Deinonychus

User avatar

Joined: 14 May 2008
Age: 55
Gender: Male
Posts: 313
Location: UK

28 Feb 2010, 7:34 pm

Apple_in_my_Eye wrote:
I've had rare moments where I've needed DOS to do something.


yes, i get these too.

recently i needed to remove files older than a few days from a directory and copy the remaining files to another server. this had to be done every day at 5am on a vanilla Win2K install.

the quickest way (for me) was to just write a DOS batch file and schedule it to run every day,