VOGONS

Common searches


Autoexec.bat question

Topic actions

Reply 20 of 22, by peterferrie

User metadata
Rank Oldbie
Rank
Oldbie

[quote="peterferrie"]
A colon is not a valid drive letter, so the rest of the line, which is treated as filename and parameters, will fail to execute.
However, for DOS prior to v7, it still attempts to *execute* that line (result: "Invalid drive specification" and "Bad command or filename"). Later versions of DOS know that it can't run, so they skip the line silently.
[/quote]

[img]http://i.imgur.com/WSwjD.png[/img][/quote]

Yes yes, now try it without the space, directly from the command line.
You'll see the messages that are merely being suppressed while running from inside the batch file.

Reply 21 of 22, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Typing a valid goto label with a single colon at the prompt results in "Bad command or filename", so there is probably different handling for batch files.

When typing at the prompt, if you lead with three or more colons instead of just two, or just put a space after two colons, it seems that what you entered is ignored with no errors given in DOS 5 and 6... I guess the interpreter just gives up under those conditions. 😉

Reply 22 of 22, by SquallStrife

User metadata
Rank l33t
Rank
l33t
ripsaw8080 wrote:

I purposely omit a space after :: because it's possible that label comparison breaks at the first separator, so perhaps another test with an added space will be different.

The second colon is what should break the comparison.

But yeah, that seems like a pretty good test, I'll try it out later.

ripsaw8080 wrote:

Typing a valid goto label with a single colon at the prompt results in "Bad command or filename", so there is probably different handling for batch files.

This.

There's no reason to expect that batch files would suppress those kinds of errors.

VogonsDrivers.com | Link | News Thread