Site hosted by Angelfire.com: Build your free website today!
Safer Startups using Batch Files

This process should apply to Windows 95 and Windows 98, but I haven't seen too many Windows 95 systems that could benefit from this.

Read each entire section before doing what it says to. If you don't understand part of a section, undo any changes you made to the registry and put your startup directory files back into the startup directory.
----
I'd only suggest you try this if your computer often crashes during startup, but if you suspect that multiple programs loading at once during startup makes your computer run worse, trying this might fix the problem.

These instructions are just guidelines to how and why this method works. You'll have to know a little bit yourself to actually do it...so don't read this expecting to have all the details about how to do it. You should be experienced in restoring the registry from DOS, modifying registry commands, and you should be familiar with most of the simple windows capabilities. If you read this, and you can't understand it, you shouldn't be messing with these settings just yet.
----

Overview:
------
This is a simple overview of what you'll be doing.

Backing up your registry.
(you also have to be able to restore your registry from DOS for this backup to help you any.)

Getting the command lines from your StartUp files and putting them in a Text file.
Moving your StartUp files to a backup directory.

Getting the command lines for programs you want to load slower from
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\"
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\"
and
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices\"
and putting them in the same text file you used for the StartUp shortcuts.
Adding (batched) to the beginning of all the registry commands you put in your Text file.

Adding the commands to a batch file like the one below.
Saving it as a .BAT file where you can easily find it.
Adding a shortcut to it in your StartUp directory.

If you don't know how to do any part of that, you shouldn't attempt this procedure.
------

General Information:
I recently found a way to severely reduce the number of times my Windows 98 computer would crash during startup. It was a big, black, plague of a problem to have JUST started my computer, and already have it crash...but I finally figured out that it was crashing because everything was loading all at once and probably disagreeing with the other programs doing things at the same time.

It's had the added bonus of making my computer more stable during the rest of the time it's on, so I just think it's a good idea to switch from the RUN registry entries and the startup menu items to a slower BAT file.

If you're worried about loading times, it's only a little delay for each thing that loads. I, personally, spend a maximum of 10 extra seconds waiting for stuff to load, and it definitely saves time by having booted successfully every time since I started using the batch file, and by keeping my system more stable for the rest of the time I use it after startup.
I made it run minimized, so I can also do stuff while it's all loading.

A word of caution: System tools like "scanregw.exe", which scans the registry for errors, shouldn't be put into the batch file. You would only find that one in the registry, but if you're like me, you might be tempted to try putting it in the .BAT.


Details:
You can find stuff to load with a .BAT in the following places:

[Start]>Programs>StartUp (C:\Windows\Start Menu\Programs\StartUp):
------
For this, you should make a backup directory to MOVE the "StartUp" files to.
DON'T delete the files. You may want or need them later.
If you right-click the start menu, you'll get the "Explore" option. That's the quickest way to there.
Make a new directory in the "Programs" directory like "StartUp_Backup", then cut and paste all the StartUp files into the new directory.

In the backup directory, go to each of the files' properties menu and copy the "Target" text to a file so you can use it later. I'd recommend you save the file just in case you need to close it. Remember not to change any of the information in the properties menu or the text file.
------

Registry:
BACK-UP the registry before you start messing with it.
------
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\"
is one place to find startup files. Copy the command from each Value into the same text file you used for the "StartUp" directory, then add (batched) to the front of it to make it stop loading, but still have the original command if you need to get it back later.

"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run\"
and
"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices\"
also have Startup commands, so you should check them too.
------

Some programs refresh their Registry/Startup entries when they start, so you may have to disable certain options in them to keep them from doing that.


Customization:
I suggest you name the file something like "Startup.bat" or "Start_Up.bat", so you won't go through and delete the file by accident. If you did delete it, you can always make another by using the files in the "Startup_Backup" and the registry entries with "(batched)" in front of them. Just another reason not to load important commands from the .BAT. DO NOT save your batch file as Autoexec.bat. If you replaced Autoexec.bat, you didn't follow my instructions about reading an entire section before doing what it says to, and it's your own fault for all the problems it causes.


This is the basic batch setup. You should put the Command Line between the ""s in the file, just as a precaution. The ""s make sure it treats the whole line as one command.
---------------------------------------------------------------------------
@echo off
choice /c:abcdefghijklmnopqrstuvwxyz /t:a,06
IF NOT ERRORLEVEL 1 GOTO END
IF ERRORLEVEL 1 GOTO 1

:1
cls
start "(Execution Path&Filename 1) EX. ["C:\Program Files\PopUp Killer\PopUpKiller.exe"]"

choice /c:abcdefghijklmnopqrstuvwxyz /t:a,03
IF NOT ERRORLEVEL 1 GOTO END
IF ERRORLEVEL 1 GOTO 2

:2
cls
start "(Command goes here)"

choice /c:abcdefghijklmnopqrstuvwxyz /t:a,03
IF NOT ERRORLEVEL 1 GOTO END
IF ERRORLEVEL 1 GOTO 3

:3
cls
start "(Leave important system tools like scanregw.exe in the registry.)"



:END
cls
---------------------------------------------------------------------------


If it's too slow and it's taking forever, or it's too fast and one program isn't done loading before the next one begins, you can set the number of seconds it will wait before executing the next command.

For [choice /c:abcdefghijklmnopqrstuvwxyz /t:a,06]
I recommend that 06 be 05-07.

For [choice /c:abcdefghijklmnopqrstuvwxyz /t:a,03]
I recommend that 03 be 02-04.

If these numbers are still too slow or too fast, you can
set them to what ever numbers you want, from 01-99 seconds.


While it's running, you have the option of immediately starting the next program or making it stop loading stuff.
While the batch file is the active program, you can press the following keys to make it perform other actions:
A - This makes the next program start loading right away.
B-Z - Pressing any other letter will make the batch file quit.


To add another command, just copy what's between the following --s, and add it after the last set and leave one line before the ":END". You should be able to figure out the pattern if you just take a look at the example above.


Replace the #s with the next in their sequence. You should replace both [#]s with the same number.
Replace the [echo Startup Command Goes Here] with the command you want to run.
--
choice /c:abcdefghijklmnopqrstuvwxyz /t:a,03
IF NOT ERRORLEVEL 1 GOTO END
IF ERRORLEVEL 1 GOTO #

:#
cls
start "echo Startup Command Goes Here"
--


I'd suggest you use Notepad to save it as a .BAT, because it's better about giving files the extension you specify.

Now, make a Shortcut to the batch file in your "StartUp" directory. This will make it so you can't just get rid of the used file as easily.

Once you have the shortcut in your Startup folder, go to the shortcut's "Program" tab, and set "Run:" to "Minimized". This makes it so it'll only appear in the task-bar.


If you want to edit your batch commands, open notepad, browse to the directory you saved the .BAT to, type *.BAT in the "File name" box, and then you can select the .BAT file you saved.

Troubleshooting:
If, when you run the batch, you get a message about not being able to run the programs in DOS mode, click the "Advanced" button in the file properties, and uncheck the "Prevent MS-DOS-based programs from detecting Windows" box.
I turn it on all the time for some reason I can't remember, and this was the first time it's ever caused me trouble.
startup crashing crashing crashing crashing windows98 crashing crashing windows98 windows98 booting loading starting booting loading starting batch BAT .BAT .bat