why does program shut off when running

when i am running a scan after a while the program closes on its own? it still has more to scan then to. also is there anyway to scan before windows starts up, like i did when i first installed the program

It would be good if you can go to the program settings and turn on the creation of the report file (with “OK files” to be included as well in the report). This way, you can find out where the scan really stopped (it’s going to be close to the end of the report). After avast! disappears, check the end of the report file - the “troublesome” file is likely to be close to the end (close in the sense that this particular file will probably not be written in the report, but the previous one will be the last line, so it shouldn’t be hard to guess). We would certainly like to have this file - if it really causes problems to avast! - so that we could fix the problem.
The report file created (if you turned it on in program settings) will be (default location) at \Data\Report\Simple User Interface.txt

Scheduling the Boot Time Scan

Click on the Menu button.
Choose Schedule Boot Time Scan.
Doing so displays a dialog allowing you to schedule virus scanning.
Check Archives, if you want scan all the archives.
Specify whether all the disks or just a specific folder should be scanned.
Select Advanced options for scheduling details.
Select how to automatically process infected files.
Choose how to automatically process infected system files.
Click the Schedule button to confirm the settings.

Or just run:
C:\Program Files\ALWIL Software\Avast4\sched.exe /A:*