nitro2k01 wrote:
bats: I use them for simple things, but they're nowhere near the beauty of shell scripts.
For example, here's my mdx.bat. (If you don't see what it does, you probably don't need it anyway)
Code:
@echo off
mkdir %1 %2 %3 %4 %5 %6 %7 %8 %9
start %1 %2 %3 %4 %5 %6 %7 %8 %9
I have to admit, I haven't a clue what this batch file is supposed to do.
You pass it some indeterminate number of parameters, if none, it falls over.
If you pass more than nine, it ignores the rest.
It maybe creates the first up to nine as directories, below whatever directory you happen to have invoked the bat file from.
I can't recall what MSDOS does when you attempt to create a directory that already exists. Probably runs crying to its mama?
It then invokes whatever "start" is, in a similar vein, so far as parameter count goes. From ahayes we have the idea that this might be to run explorer. In actuality, it will follow whatever MSDOS happens to find as a result of its laughable "rules". Typically, that might be to run the local START.BAT, which may or may not understand the parameters.
What I always found wildly incensing (and I mean that - it annoys me no end), is that MSDOS will prefer to run the local START.COM and if that doesn't exist, the local START.EXE, only finally looking for a BAT file. I never could see any logic to this - totally mad. If I want to "front end" an existing command, I'd like to do that with a quick BAT file. Mind you, if I'm a virus writer, I can surreptitiously override a transparent BAT file with an obscure EXE or COM. That makes sense?
_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports."
Kamran Nazeer