View Full Version : For Dos-heads. An autoexec.bat conundrum, but not life threatening...

Terry Porritt
21-09-2003, 09:00 AM
I've gradually become aware that my autoexec.bat file (Win98SE OS) 'has a mind of its own' !!!

When I installed a Triplex Ma-La-Zi sound card (never heard of it???? neither had I), a line was installed at the head of the autoexec.bat;


Nothing unusual about that, but I moved that line to below the command ;
so that it would not appear on the screen as autoexec was being processed.

I became aware that the SET command was appearing on the boot screen, and discovered the command was back at the top ot the autoexec file.

Moving it back below the @ ECHO=OFF command is only temporary, at the next boot up it is moved back to the top again.

The only way to keep it where I want it, is to make autoexec.bat a read only file.

Now logic tells me that the sound card software is everytime somehow checking the autoexec.bat file at some stage in the start sequence after IO.sys and msdos.sys have been processed, and if it doesnt find the SET BLASTER at the top it puts it there and deletes or moves the existing SET command.

This seems very strange, I cant find any sound card file that would do this, but.....
Anyone come across this sort of thing before?

21-09-2003, 09:41 AM
I've noticed that with some settings I try to disable, that they come back. Even change them slightly and the software re-inserts itself in the right place.
Not sure there is anything you can do to stop it without removing the driver.
You could try making the autoexec.bat read only, I suppose.

Tom McB
21-09-2003, 10:00 AM
Robo's reply pretty much sums up what you can do at this point.

Why not set it only when you want to run some 'legacy' stuff?


21-09-2003, 11:23 AM
Terry, it's been a long time since I've used autoexec.bat with Win 9x, but I have a feeling it uses a variety of files, one for each different kind of boot-up. Perhaps you've edited one of them, but not the one that is run on the Win 98 boot?

Just a thought.


Terry Porritt
21-09-2003, 11:49 AM
It's all very odd, but it doesnt do any harm. If I delete the SET BLASTER command it re-appears next boot up. Im sure it hasnt happened with other soundcard software, and why go to the trouble of writing software to do that?

I'm sure Graham will have a suitable comment to make :)

21-09-2003, 01:05 PM
Is there an "autoexec.dos" file lerking on the hdd?

Terry Porritt
21-09-2003, 02:00 PM
Yes Mark, there had been. It was made by the soundcard installation and only contained a dos driver installation program and a dos sound configuration program, but I had moved this sometime ago into a backup root files folder.
So this isnt having any influence.

As I said there is no real problem, just find it a bit of a puzzle.

Graham L
21-09-2003, 03:00 PM
"mention the Devil's name and you wil hear the beating of his wings".

"... why go to the trouble of writing software to do that?" Someone went to the trouble of writing Windows™. :D

Maybe they got tired of getting user complaints of the nature; " I took out the SET BLASTER line because my card isn't a SoundBlaster, and it stopped working".

It's odd that it actually moves the line. That shows commendable skill and determination. I've seen (installation code) that puts its lines at the start of the file, and comments out anything else referring to similar hardware (even its own hardware :D if it's being installed again for some reason.) If you've played with various pre-ASPI CD Roms, you'll have seen this syndrome.

21-09-2003, 04:31 PM
I've run into programs that insert/modify the BLASTER line. But none have moved it.

If it only happens when you boot into windows it will be the windows driver doing it. If it happens booting straingh into DOS look for something else sound related in config.sys/autoexec.bat, or even dosstart.bat.

My guess is its happening because of lazy coding on their part. I assume it is easier for them to delete the old line and put a new one at the start. Rather than trying to insert it at the old place.

It may even be getting replaced it at every boot. You could check this by leaving it at the top but changing the formatting slightly, eg extra spaces.

Terry Porritt
21-09-2003, 05:46 PM
You're absolutely correct Brett. If extra spaces are inserted into the SET command, then after the next boot they have gone, confirming that the SET command is deleted and re-written each time.

I actually have a multi-configuration in config.sys/autoexec.bat to give a menu with the option to either start Dos or to start Windows.
The SET command gets read first with either option.

22-09-2003, 01:12 PM
Your autoexec.bat doesn't really say @ECHO=OFF does it?

Slight mistake I believe.

Now I'm unsure what the operator = does, since my batch programming has kinda been outdated, but ECHO = OFF probably does as it says. I'd change the line @ECHO=OFF to @ECHO OFF

Terry Porritt
22-09-2003, 02:07 PM
Very interesting Kame. Checking back through print outs of past autoexec files echo=off seems to have crept in about 2 years ago, probably as a typo.
However '=' doesnt seem to cause any problem, it appears to work identicly to echo off, or rather as though it isnt there. There is no bad command error message either.

Thanks for for drawing my attention to that, I wonder what else I see all the time but dont take in or really notice? :)

22-09-2003, 03:27 PM
If you go into dos and type @echo=off you'll see what it does.

It just prints out "off" to the screen. What @echo off is meant to suppress messages being printed to the screen.

If you have Win9x, at the Win9x loading splash screen (after reboot or just turned on the computer) press ESC key to see what goes on underneath.

Graham L
22-09-2003, 05:11 PM
Good to learn that DOS doesn't make an environment variable with the name of a command. :D

However that line is extremely unlikely to cause the [i]interesting[/b] problem.

Is it a Microsoft advanced feature, perhaps? Automatically repairing changed essential OS files? ;-)

Terry Porritt
22-09-2003, 07:47 PM
I dont have a splash screen Kame, as I like to see what is going on, and all autoexec commands have been suppressed from showing on screen (all except the SET BLASTER command which is being written before the @echo command), even though the echo command was not right. How strange, that was why I didnt pick up the typo.

Terry Porritt
22-09-2003, 07:55 PM
This is my autoexec.bat Kame, with the correct @echo command. You can see how much would appear on screen if there was no @echo command, hardly likely to miss it. :)

GOTO %config%
PROMPT $E[35;40;1mTerry's Computer $E[1;33m$P$G$E[37m
rem - By Windows Setup - LH C:\WINDOWS\COMMAND\MSCDEX.EXE /D:MSCD000
PROMPT $E[35;40;1mTerry's Computer $E[1;33m$P$G$E[37m

22-09-2003, 08:49 PM
Is there a bug with pressf1 insert a mystery spaces?

there's a space in the PATH= with the word COMMAND but I'm sure it's not your fault.

I'd check config.sys see what sound driver is being loaded. This maybe changing your autoexec to display the command at the top of the autoexec before all other commands are executed since they made sure they were given the resources and not some other hardware.

Terry Porritt
22-09-2003, 09:29 PM
Yes Kame. Press F1 does put extra spaces in for some reason especially long lines and long URLs.
Quite funny, it took a colon D in the remmed line and made an emoticon out of it :D.

No there isnt any soundcard device driver in config.sys, which is one reason why I havent yet found the source of what is writing to the autoexec file.

Just experimented again putting in a '=" sign in the echo command. It makes no odds whether it is there or not. The subsequent commands are not echoed to screen.

22-09-2003, 10:51 PM
> Yes Kame. Press F1 does put extra spaces in for some
> reason especially long lines and long URLs.

Its to stop pages from getting too wide. If you remember the old PF1 if you posted a long line the ads etc on the right ended up off the screen.

23-09-2003, 11:27 PM
Just noticed that you use Win98SE, hehe, how observant :P

Win98SE doesn't rely highly on the autoexec.bat, it's there for backwards compatibility. It's mostly done in the registry now, so it's probably a driver being loaded up in there.

Go Run | type sysedit and have a look there. Displays most of the system files (win.ini, system.ini, etc...) and there maybe something there.

What happens if you remove @echo off altogether? possibly a default option of win98se is to turn it off during loading of the autoexec?

Terry Porritt
24-09-2003, 09:00 AM
Yes, Ive already looked in win.ini and system.ini, but the blaster command is being written way before windows starts.

I think I mentioned I have a multi-configuration boot in config.sys and autoexec.bat, so that I get a menu with 2 options, either to start dos, or to start Windows. it's a sort of legacy from when I first had Windows 95 and had problems loading drivers in config.sys when restarting in dos from Windows.
With that option there is no provision for a new config.sys, only a dosstart.bat.
I can remember having CDROM conflicts between protected mode windows drivers and real mode dos drivers, and other similar conflicts.
Also lack of conventional memory in dos was a problem.

Whilst Windows can do without autoexec and config files, more customisation is possible if they are there.

Also there was all that annoying Redmond hype when Win95 and later versions came out that tried to pretend dos no longer existed, culminating in Win ME

If I remove @echo off command (whether is has an equals in it or not), then of course I get a screenful of autoexec lines.

Also this "problem" isnt really a problem, just a puzzle, I like to know what is happening behind my back :)

Thanks for all your suggestions and help Kame and all.

24-09-2003, 12:37 PM
Terry, you have me confused.

If you like to know what's going on behind your back, remove @echo off :P

Terry Porritt
24-09-2003, 04:45 PM
No, you cant really be confused Kame, I'm not, at least I dont think so!

I know what Ive written in autoexec.bat, so it's not behind my back, just that I dont need to see it every time :)

Its the sneaky set blaster that was behind my back.

25-09-2003, 12:37 PM
been watching this thread with interest, I would try 2 things:

1. Start the machine in safe mode so that the sound card driver doesn't load, delete the SET BLASTER line in autoexec.bat and then restart again in safe mode and see if it reinserts the line, this would show if it was the driver initiation reinserting the line.

2. Start up in normal mode, delete the SET BLASTER line then go into msconfig and disable everything in the startup category, restart the machine and if the line hasn't reinserted itself in the autoexec.bat file go back into msconfig startup and enable each line one by one until the SET BLASTER line reappears, when it does - you know what the culprit is.

bottom line is that if you want your sound card to work you'll have to put up with it !!


Terry Porritt
25-09-2003, 03:09 PM
Thanks for your suggestions Mike. However that set blaster command gets written into autoexec.bat before windows starts, in fact before autoexec.bat is processed, and also if I start up in "pure"dos it also gets written in.

I have just found out that dosstart.bat also gets the set blaster command written into it.

I thought there may be a possibility of the command coming from the registry, as when the step-by-step confirmation via F8 is chosen at start up, the first thing to be processed is the Registry. Now I assume this is processed even if dos is started instead of windows. However if the Registry is chosen not to be processed dos can still be started.

I searched the Registry but could find no set blaster command, so I am still no wiser as to where the hidden/obscure program is that is doing this writing, or where the activation comes from.

In Windows, the set blaster command is not needed anyway as it is for dos.

If autoexec.bat has the set blaster command deleted and the file made read only then the command no longer appears on the screen during startup.

25-09-2003, 03:44 PM
The registry won't have the SET BLASTER command, it's most likely the driver that's doing it as the driver will either be processed with the system.ini file? probably called sounddrv.sys or similar lines. I suppose remarking out the line just means it'll insert another line (REM)?

If you comment out the sound driver whereever that is and try fixing seeing whether that has any effects, possibly systemwide crash :P then it's to do with the driver.

I would have to say that this is not a problem apart from not being able to do what you want with the line so I guess it's just one of those things. How important is autoexec for you? I'd rename it to autoexec.bat.bak and config.sys to config.sys.bak and have an empty autoexec.bat file and config.sys file and see what happens.

Terry Porritt
25-09-2003, 04:28 PM
Windows is really just a red herring Kame, as dos doesnt need system.ini, in fact its name can be changed and dos will still start. This is looking like a very cleverly hidden dos program/file somewhere that is somehow told to start when the boot process is started and write the set blaster command, which is after all a legacy feature for sound in dos.

It may be much like the hidden dos files that were sometimes used in dos shareware to count up the number of times or days the shareware had been used for.

I need and want my autoexec and config files, I would feel lost without them :)

But I would like to know exactly what happens when the registry is processed on starting, but then instead of windows, start dos which doesnt need the registry?

Graham L
25-09-2003, 04:32 PM
Maybe they are extra clever and have put a ROM with BIOS extensions on the card, like a VGA or SCSI card. :D That's about the only way to get code executing before the DOS boot.

Terry Porritt
25-09-2003, 06:22 PM
I think you could be right Graham. Those fiendishly clever Chinese :)

26-09-2003, 02:23 AM
Well whip the card out and let us know how you get on :)

Terry Porritt
26-09-2003, 11:23 AM
I did as you suggested JM, good thinking, but oh dear back to the drawing board.

I removed read only attribute from autoexec.bat, switched off, removed the soundcard, switched on and booted into dos.
Lo and behold the set blaster command reappeared, so the command is not in any soundcard bios.

One thing I have forgotten to mention is that when the set blaster command is written, the mysterious program makes a backup of the existing autoexec and calls it autoexec.fm.

Incidently, in Device Manager, the soundcard is listed as Triplex Ma-La-Zi FM801 PCI Audio, that presumably is why the above file extension is .fm.

I think I've pretty well done this thing to death, it's a good job this puzzle is not life threatening.

The inscrutable Chinese wouldn't write soundcard software that could modify the IO.sys system file would they??
Certainly where this set blaster instruction is coming from is totally inscrutable :)

26-09-2003, 12:25 PM
Oh well, good luck finding out. :) It sure does sound rather strange.

Graham L
26-09-2003, 05:19 PM
Well, Terry, that's easy to check. Even if you havn't got the strings programme, you can use list to look for the string. grep is around for DOS , too ... (I'm sure it would be somewhere in Simetl) and that would look at everything in the root directory verty quickly.