Jump to content

About AUTOEXEC.BAT


Recommended Posts

Is there a norm for autoexec.bat, autoexec.dos, and dosstart.bat and how critical to the optimum performance of Windows are they? It would be interesting to know how others' files are configured and whether any lines are either missing or superfluous ... :wacko:

Here is my autoexec.bat (I have made autoexec.dos and dosstart.bat the same if that makes any difference to anything) :-

C:\PROGRA~1\GRISOFT\AVG7\BOOTUP.EXE

SET TEMP=C:\windows\temp

SET TMP=C:\windows\temp

SET TVDUMPFLAGS=8

SET PHPRC=C:\PHP

SET PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\;C:\WINDOWS\SYSTEM;C:\PROGRA~1\COMMON~1\ROXIOS~1\DLLSHA~1;C:\PERL\SITE\BIN;C:\PERL\BIN

mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)

mode con codepage select=850

keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys

Edited by plonkeroo
Link to comment
Share on other sites


There is no "norm" for autoexec.bat or any other configuration files. They are written for you and your system, not for someone else. My autoexec.bat file probably won't even work in your system.

I can tell you what your autoexec.bat does, so you can decide yourself if you like it or not.

C:\PROGRA~1\GRISOFT\AVG7\BOOTUP.EXE <-this is added by your antivirus scanner.

SET TEMP=C:\windows\temp

SET TMP=C:\windows\temp <-these two lines set the location of your temp directory.

SET TVDUMPFLAGS=8 <-I don't know what this is.

SET PHPRC=C:\PHP <-I don't know what this is. PHP doesn't need any enviroment variables.

SET PATH=... <-list of dirs where executable programs and .DLL files can be found if path is not written and program/DLL is not in current directory. It's not really necessary. You can remove it, unless you use command prompt and you don't like typing those paths.

mode con codepage prepare=((850) C:\WINDOWS\COMMAND\ega.cpi)

mode con codepage select=850

keyb uk,,C:\WINDOWS\COMMAND\keyboard.sys <-loads the files for DOS codepage and keyboard. If you only use english, you can remove them too.

If you restart in MS-DOS mode with a custom config.sys and autoexec.bat written in Exit To Dos.pif, then you don't need dosstart.bat.

autoexec.dos is a file created by DriveSpace. I never found out what it does. I always delete it when I see it. :)

For more information, extract HELP.COM and HELP.HLP form a DOS v6.x setup. Run HELP.COM and you will find a description for every DOS command.

My autoexec.bat:

@ECHO OFF
C:\2\LETASSIG\LETASSIG.EXE @LETTERS.INI /O:DRIVEMAP.DAT /CD
SET COMSPEC=U:\COMMAND.COM
SET TEMP=U:\TEMP
SET TMP=U:\TEMP
SET PATH=%PATH%;U:\PACK\UC2
SET BLASTER=A220 I5 D1 H7 P330 T6
SET SBPCI=U:\DRIVERS\SBPCI
LH MODE COM1 19,O,8,1,B
DEL %TEMP%\~DF*.TMP<U:\Y>NUL
CHOICE /T:N,3 Options?
IF ERRORLEVEL 2 GOTO Next1
CALL U:\1\SYSTEM\OPTIONS.BAT
:Next1
IF EXIST C:\WINDOWS\WININIT.INI MORE C:\WINDOWS\WININIT.INI

OPTIONS.BAT is a file that changes kernel and explorer.

Edited by Marius '95
Link to comment
Share on other sites

Many thanks, Marius'95. TVDUMPFLAGS= is a ZoneAlarm thing. PHPRC= was installed by the PHP programme.

postscriptum - just over the last couple of days something has been wiping clean my autoexec.bat. Can't be a virus or anything like that as I've scanned the machine most thoroughly with AVG, ZoneAlarm, and SpyBot. Any ideas, anyone?

Edited by plonkeroo
Link to comment
Share on other sites

All the way back to my early days with Dos 2.0, batch files like Autoexec.bat have had certain forms to follow.

Every batch file I ever wrote over the past 27 years started out:

@Echo off

cls

@Echo Off turns off the echo so the commands don't print out on the screen as the file runs.

CLS, clears the screen of any text that may be left over from the Config.sys file, or anything else that's gone before it.

From there on its pretty much a list of dos commands to set up paths, temp file folders, run special drivers etc.

Like was previously said, there is NO standard Autoexec.bat file since every computer is (possibly) different.

Then along comes Winders XP and it don't even use an Autoexec.bat file. (because it doesn't use DOS).

Cheers,

B)

Link to comment
Share on other sites

postscriptum - just over the last couple of days something has been wiping clean my autoexec.bat. Can't be a virus or anything like that as I've scanned the machine most thoroughly with AVG, ZoneAlarm, and SpyBot. Any ideas, anyone?
It's just happened again, just a completely blank autoexec.bat! It's a sod because if I don't catch it when it happens the machine just flounders on the next reboot.

@Marius '95, Andromeda43 - Thanks but '@Echo off, cls'? What do these mean and, pardon my tech-ignorance, what do I actually do?

Edited by plonkeroo
Link to comment
Share on other sites

@ECHO OFF = should be the 1st command line of any DOS batch file.

@ = makes the ECHO command itself invisible.

ECHO OFF = turns off command ECHO-ing = makes all following commands invisible.

Run:

ECHO /?

CLS = CLear Screen = wipe out the entire DOS screen display.

By itself may or may not close the running DOS batch.

Run:

CLS /?

EXIT = should be the last command line of any DOS batch that runs from within Windows [DOS box or full screen].

Closes the running batch and returns control back to the DOS command prompt.

Run:

EXIT /?

HTH [Hope This Helps]

Link to comment
Share on other sites

It's just happened again, just a completely blank autoexec.bat!

I once had a sound card's files do that to me when the entries for that card in the offending autoexec.bat file were not first and second items in that batch file. In other words, when I moved the lines around to where I wanted them - zapp!! It was only by suspicion that I was able to confirm this action as I recently installed the sound card with it's drivers and then I had the problem as soon as I moved the card's lines in the autoexec.bat file. The sound card's driver read the autoexec.bat file at shutdown and if it wasn't right, the old one got erased and a new blank one with only the sound card's lines were found. I seem to remember a lot of mispellings combined with a few just plain blank autoexec.bat files like what ever was doing it wasn't written very well. Crazy.

I think I wound up disabling the sound card's driver as it wasn't really needed but for to clobber autoexec.bat files... Extra crazy.

So perhaps you've installed something recently that has a 'driver' like the one I disabled? Type msconfig into the Run Box and look at the startup tab for programs that run when Windows starts up. Press Ctrl+Alt+Del to see running apps and strive to identify all of them. You may need to use a 3rd party process viewer http://www.teamcti.com/pview/prcview.htm to view all apps running in order to find the culprit. I don't suspect a virus or trojan for if one of those had control of your system, a lot more damaging things could be done than to just aggravate you by blanking your autoexec.bat file randomly. Is your blanked autoexec.bat file a zero byte file? In other words, does it have any size to it at all as shown under Properties? What size, if not a zero byte file? Sometimes such an app would make a backup file of your current autoexec.bat file, have you seen any such files? I've got c:\autoexec.fm and c:\config.bak just for real world examples. Common sense and what have you done recently may be your best bets.

Link to comment
Share on other sites

IMO these two lines are superflous:

Temp IS in "C:\windows\temp" by default. It's useful if you want to set it to another location.

SET TEMP=C:\windows\temp

SET TMP=C:\windows\temp <-these two lines set the location of your temp directory.

Link to comment
Share on other sites

plonkeroo :hello: :

It's just happened again, just a completely blank autoexec.bat!

Are you by chance using any "tweaks" from WinME on your Win98SE? WinME does not like anything in AUTOEXEC.BAT or CONFIG.SYS... those setting are stored in the Registry under WinME and the two aforementioned files are "wiped" on startup...

Link to comment
Share on other sites

plonkeroo
It's just happened again, just a completely blank autoexec.bat!
Are you by chance using any "tweaks" from WinME on your Win98SE? WinME does not like anything in AUTOEXEC.BAT or CONFIG.SYS... those setting are stored in the Registry under WinME and the two aforementioned files are "wiped" on startup...

@ submix8c - I must have umpteen WinME files thanks to MDGx and other stalwarts on these forums!

@ Fredledingue - I shall try that

@ All - Thanks for your fascinating insights!

:hello:

Link to comment
Share on other sites

It's just happened again, just a completely blank autoexec.bat! It's a sod because if I don't catch it when it happens the machine just flounders on the next reboot.

I once fooled a collegue by putting some annoying things in autoexec.bat. To make it more difficult to find the problem, I renamed autoexec.bat to somename.bat, and edited io.sys to meet this name. Somename.bat called autoexec.bat, so it was hard to find this.

I don't know if WinME dos can be fooled the same way, but it's worth a try. Open io.sys in a hex editor, find all autoexec strings, and replace them with some other name. (Take an 8 character name for alignment). Then rename autoexec.bat to this name. When windows for some reason wipes your autoexec.bat, I suppose it will not scan io.sys for the name to use. Of course you should save a copy of io.sys first, and make sure you can boot from floppy to replace io.sys.

Link to comment
Share on other sites

It's happened yet again! autoexec.bat wiped completely clean and my machine floundering on reboot!

I was wondering ... Would it be possible to make a floppy which could fix things when the rebooting went awry? Or, perhaps, an onboard file of some kind which would auto check for a blank autoexec.bat and fix it before the reboot?

Any comments, anyone, and hopefully someone would know how either of these options could be implemented?

:blushing:

Link to comment
Share on other sites

You should try to find out when the autoexec.bat get wiped off.

Here is a small script allowing you to restore autoexec.bat.

It checks if the batch file has less than 10 bytes (practicaly empty) and copy autoexec.bak under .bat.

Make sure autoecex.bak is identical to theautoexec.bat (open the two files in Notepad) (you can use another name or extention if you want, if you modify this script).

Copy-paste the following code in Notepad and save it under Autoexec_restore.vbs. create a shortcut to this script on your desktop for easy access.

Set fso = createobject("scripting.filesystemobject")
If fso.getfile("C:\autoexec.bat").size < 10 Then
fso.getfile("C:\autoexec.bak").Copy "C:\autoexec.bat"
MsgBox "Autoexec.bat restored!",,"Autoexec restore"
End If

HTH

Edited by Fredledingue
Link to comment
Share on other sites

You should try to find out when the autoexec.bat get wiped off. Here is a small script allowing you to restore autoexec.bat. It checks if the batch file has less than 10 bytes (practicaly empty) and copy autoexec.bak under .bat.

Make sure autoecex.bak is identical to theautoexec.bat (open the two files in Notepad) (you can use another name or extention if you want, if you modify this script). Copy-paste the following code in Notepad and save it under Autoexec_restore.vbs. create a shortcut to this script on your desktop for easy access.

Set fso = createobject("scripting.filesystemobject")
If fso.getfile("C:\autoexec.bat").size < 10 Then
fso.getfile("C:\autoexec.bak").Copy "C:\autoexec.bat"
MsgBox "Autoexec.bat restored!",,"Autoexec restore"
End If

Thanks, I'll give it a try!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...