ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

DOS Batch Functions Tutorial

<< < (5/6) > >>

db90h:
Yes, BATCH files weren't designed for complex scripting at all. Not like *nix shells, which were designed that way from the start. I still prefer *nix.

PowerShell, despite it being a resource hog like you wouldn't imagine, is very powerful. It can let you script almost anything you could code in .NET, minus all the UI stuff maybe. At least, that's my understanding of it. I have not taken the time to learn, nor care to learn, the internals of it either. Whether the product even survives remains to be seen. I'm sure some network admins are using it for some automation tasks, but that's about it. Nobody really took to it. They'd do better off pushing their POSIX subsystem on admins, and give them an interface common to Windows and linux. Of course, the *nix style scripting came from decades ago and isn't the most efficient thing in the world, but with the help of numerous facilitating tools you can do pretty much anything you want. PowerShell could have been much more efficient, and might be for large and very complex scripts, though its .NET MSIL overhead makes it slow .. so who knows on that one. They *did* include some unix commands in PowerShell, ironically.. at least named the same, different options and output format -- just to confuse people.

kyrathaba:
though its .NET MSIL overhead makes it slow ..
--- End quote ---


Ah, but slow relative to what?  I can't imagine PowerShell programs being speed-critical.

IainB:
Rather than a DOS batch functions tutorial, would it be of more current relevance to use Window Scripting?
There's an interesting post about it here: Better Than Batch: A Windows Scripting Host Tutorial

Just a thought.

kyrathaba:
+1.

I think that, in general, WS would be preferable, although there might be so esoteric situations where a small batch file might be preferable.

IainB:
@kyrathaba: I didn't know anything about Windows Scripting until I read that post.
I am not sure, but maybe this is what @mwb1100 was referring to when he wrote in the above thread:
The book "Windows NT Shell Scripting" by Timothy Hill has about the best coverage of how to do complex processing with batch files that I've come across (get a used/remaindered one for the cost of shipping).
--- End quote ---

@justice: Could this (Windows Scripting) be a potential alternative answer to what your original Q was about? (I ask the question in gnorance as to what your full requirements might be or why they might have necessitated the use of DOS batch in the first place.)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version