Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
here is my autoexec.bat:
====beginning of autoexec.bat===
@ECHO OFF
PROMPT $p$g
PATH C:\NET;C:\DOS;C:\turbop7\bin;C:\BORLANDC\BIN
SET TEMP=C:\DOS
doskey
echo enter autoexec.bat; go to the section that matches the current value of the CONFIG system variable
goto %CONFIG%
:normal_conf
echo enter normal configuration
goto end
:debug_conf
echo enter debug configuration
goto end
:net_conf
echo enter net configuration
C:\NET\net initialize
C:\NET\nwlink
C:\NET\net start
rem c:\net\net start server
goto end
:end
====end of autoexec.bat===Why does "Bad command or file name" show every time I restart the computer?
What's more this message shows between "Enter autoexec.bat" and "enter XXX configuration" where XXX maybe normal, debug or net.
I'm really confused about this.Anyone here can give a hint?

That may be caused by your comment line beginning with ";". Try the native batch comment identifier Rem and report if the annoiance stops.

That's likely it - semicolon can be used in config.sys, but not batch files.
Double colon is an alternative ::
Never argue with an idiot. They will only bring you down to their level and beat you with experience

doskey might also be the prob. as it might have been deleted. I use ;s in batch files but I haven't had a bad command or file name from them.
Customer: Do you have any mouse pads?
Salseman, pointing: Over there.
Customer: Great!, will they be comadible with my computer.

The semicolon doesn't do anything at all, so the line go to the section that matches the current value of the CONFIG system variable (or a portion of it) attempts to execute - hence the 'bad command' message.
Not even going to ask why you use semicolons in your batch files (in case you tell me)
Once again your insights & obvious experience have proven invaluable, and your contributions here... well, they defy description.
Never argue with an idiot. They will only bring you down to their level and beat you with experience

Thank you all very much.
I write autoexec.bat according to an example in DOS help. You may find it in the section
"MS-DOS Help: Multiple Configurations -- Examples".

Does the %CONFIG% variable method even apply to real DOS (6.22)? 98's boot disk uses it but gets it from config.sys [menu] and selection from the menu then setting the %CONFIG% variable. I find it a little hard to believe that 6.22 supports it at all (I don't have 6.22 or I would know). And according to the batch file posted, Shi is trying to use it as given from config.sys.
May we also see config.sys? Also exact DOS version please.

Yes - the multiple configuration feature was introduced with MS-DOS6 - believe it.
Exact version already given (??)
What point in seeing config.sys?? - for a fact, 'bad command or filename' cannot be generated from such.
Anything else?
I'd say the problem was resolved with IVO's post - it's the absence of the REM statement, so the 'comment' is processed as a command.
No real confirmation from the OP - the cited source does indeed use semicolons in place of REM - it is in error though. Try it.
Never argue with an idiot. They will only bring you down to their level and beat you with experience

Hi gang,
Yes, the semicolon in DOS is no good as a substitute for rem.
But a double colon is.
DOS "sees" it as an unaddressed label.
Yes, I think IVO nailed it.
When I have an error situation like this, I put a pause below the suspect line.
M2Mechanix2@Golden-Triangle.com

Well, it just won't work in BATs (for config.sys it's ok)
If in doubt, F8 at bootup for line-by-line confirmation.
For other batchfiles use 'command /y /c mybat.bat' to debug
Never argue with an idiot. They will only bring you down to their level and beat you with experience

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |