Bootvis 'Optimize System' Restart

B

bonapardo

Hi,

I have had the following issue with my PC for about a year…

During startup, Windows often takes a long time to leave the XP splash (or
logo) screen before kicking in to the welcome screen. I’m not too bothered
about slow load times in themselves – my PC is not the newest and it is to be
expected. Sometimes however, the computer loads fine – the splash screen is
up for a short period before Windows proper kicks in. It tends to go through
periods of loading slowly, occasionally being okay if restarted – mostly not
though. Around a year ago, I found that whenever the machine had loaded
slowly, the frame rate when playing DirectX games was seriously degraded
(about halved). When loaded quickly, everything ran like a dream. Later
investigations showed that encoding an MP3 took twice as long as well. This
made me think that whatever the problem, it was affecting my processor –
effectively halving its power.

I have tried everything, from physically removing internal components one by
one, preventing unnecessary services from starting, clean boots (msconfig),
system restores, repair installations, full virus and spyware scans, defrags,
all the usual stuff (all at least ten times) apart from a complete rebuild.
A rebuild is not the answer for me because it provides no answers – after all
this time, I NEED to know what is going on.

Testing has been a problem because the system would sometimes load okay for
one or two times after a change, leading me to think it resolved the issue,
only to find a day or two later that the problem returns.

For the record, without fail, loading into safe mode is almost instant, not
a problem at all.

So then I ran Bootvis. The results from bootvis were uninspiring – simply
showed absolutely no activity during the period at the splash screen.

HOWEVER…

Using Bootvis, I found a workaround which has worked on five separate
occasions – though I accept this may still be chance. When specifically
using the ‘Optimize System’ option, NOT running a Trace, the reboot that
Bootvis performs prior to the optimization loads my system quickly and I get
the full performance from Windows (FPS benchmark and MP3 encoding) every
time. After such a restart, another restart (not through Bootvis) exhibits
the same slow loading. Bear in mind I am writing about an Optimize System
restart and not a Trace restart (which still loads slowly).

Once successfully loaded quickly, I have to kill the BootvisSleep process
and delete it from the Bootvis program files directory. To enable me to
restart again using Bootvis, I have to select ‘Optimize System’ again, allow
the (post-restart) optimization to begin then I can kill the Bootvis process.
Only by doing this can I force a restart next time I ‘Optimize System’ in
Bootvis.

After all the above, my question is… what does Bootvis do during an
‘Optimize System’ restart which differs from what XP would do normally? And
is there any way, without performing this workaround using Bootvis, that I
can replicate such a restart of my system?

Thanks in advance,

Ben.
 
J

John John (MVP)

bonapardo said:
[snippage]
After all the above, my question is… what does Bootvis do during an
‘Optimize System’ restart which differs from what XP would do normally? And
is there any way, without performing this workaround using Bootvis, that I
can replicate such a restart of my system?

It just defrags the prefetch files and the files/applications that load
at boot time and moves them closer to the begining of the hard drive so
that they can be accessed more quickly when Windows boots. Windows XP
does this automatically every 3 days but you can do the same thing by
running defrag c: -b at Command Prompt.

John
 
B

bonapardo

Thanks for your swift response John, but as I understand it, that is what
happens during the optimisation process itself, not during the initial
re-boot of the system before windows restarts and begins optimisation. I've
just re-read my post and it does seem a bit vague to be honest. Basically,
when using this workaround and Bootvis has restarted my PC and I've logged
into Windows, I kill Bootvis before it gets a chance to actually optimise my
system.

What I'm really interested in is if Bootvis, when specifically using the
'Optimize System' option, performs a restart that differs from a normal
restart. It would appear from my benchmarking that it does...

Thanks again,

Ben.
 
K

Kelly

Bootvis is a Boot performance trace visualization tool for use with Windows
XP systems. It gives a graphical view of what processes are doing what and
when during boot and allow you to optimize your boot up.

BootVis - Performance Trace Visualization Tool (Line 113)
http://www.kellys-korner-xp.com/xp_tweaks.htm

If that doesn't help, run:

Windows XP Startup Programs Tracker
http://www.kellys-korner-xp.com/xp_u.htm#xp_util

Added info from a previous post made by David Candy:

defrag c: -b
which rearranges files according to the current layout.ini

and

Start/Run: rundll32.exe advapi32.dll,ProcessIdleTasks

which rebuilds layout.ini from the information in the prefetch folder and
and rearranges files according to the newly generated layout.ini. It also
does other tasks (such as some System Restore stuff) that windows does when
the computer is idle.

Bootvis calls ProcessIdleTasks function in advapi32.dll so automated tasks
don't kick in affect the boot monitoring and so the boot monitoring is done
on an optimised machine.

You can read about it here
http://www.microsoft.com/hwdev/fastboot/download/fastboot-winxp.ZIP
which will explain what thiose .pf files are in prefetch folder and the
registry keys that control it.

The technical documentation on ProcessIdleTask is below from the platform
SDK

Idle Task Scheduling: The ProcessIdleTask API

The file placement optimization, which is done no more often than once every
three days, is an example of a task that is carried out when the system is
deemed to be idle. System Restore and other features of Windows XP also
attempt to defer some work until the system is deemed to be idle. There are
also some done-once-after-setup work items that also operate under the Idle
Task Scheduling mechanisms.

All of these "idle tasks" are controllable by a system API in advapi32.dll,
ProcessIdleTasks. The API’s sole purpose is to allow benchmarks a simple way
to force any pending idle tasks to be executed immediately, without having
to wait a lengthy period of time.

The API ProcessIdleTasks can be called in one of two ways, from the command
line or synchronously from a program. To call ProcessIdleTasks from the
command line, use this syntax:

Rundll32.exe advapi32.dll,ProcessIdleTasks
When called from the command line, the ProcessIdleTasks work is done in the
background asynchronously. It can take 10 to 15 minutes for idle tasks to
complete. Task Manager will report processes running, and the disk will
likely be active during this time.

The ProcessIdleTasks API takes no arguments and returns a standard Win32
error code. The definition is:

DWORD
ProcessIdleTasks()

The API itself is synchronous, so it won’t return until the idle tasks have
completed.



--

All the Best,
Kelly (MS-MVP/DTS&XP)

Taskbar Repair Tool Plus!
http://www.kellys-korner-xp.com/taskbarplus!.htm

SupportSpace
http://www.kellys-korner-xp.com/supportspace.htm
 
B

bonapardo

Thanks for your post, Kelly. I have found that after an optimisation, the
machine still boots slowly so I suspect the problem is not due to the
physical arrangement of my boot files. I repeated this test using the
command line call in your post and still booted slowly. I also repeated the
Bootvis restart workaround before and after the above forced boot defrag with
successful, quick restarts on both occasions.

Bearing in mind that the slow boot symptoms are spotted at the logo screen
(i.e. the low-res, black-backgrounded XP logo screen prior to my high-res XP
welcome), is this prior to when any of the automated processes have even
started or are idle processes kicked off at the logo screen? I wonder if,
during one of these fast boots, Bootvis writes something to the boot sector
to prepare for optimisation somehow? Seems unlikely, but if it does, I want
to keep it there!

On a slow boot, my CPU usage is at 30-50% usage when idle (0-7% after a fast
boot). In the list of processes nothing appears to be using the CPU. I'm
happy that my machine is clean. I have run countless virus and skyware scans
and regularly use hijackthis and other startup utilities to monitor that kind
of activity.

That seems to point to a hidden process running. I'm not convinced that a
Windows virus, or any Windows process, could start up before the operating
system has fully loaded but my knowledge is limited on that side of things.
Not wanting to be bumped to a security forum, I still think that whatever
ill-happenings are taking place behind the xp logo screen (or soft blue
alternative using the /sos boot.ini flag) is avoided by following the Bootvis
workaround procedure. My CPU is happy when fast-booted so I don't think it's
a simple hardware fault.

This must mean Bootvis does something outside of the scope of the boot file
optimisation it is trying to achieve before Windows has fully loaded (i.e. at
the logo screen).

Please help!
 
B

bonapardo

Hi,

Anyone got any ideas on this? The key point is that my CPU is being used
constantly after a slow boot - suggesting a dodgy process running on my
machine. What would Bootvis be doing that would block such processes from
running (as early as the splash screen)?

As a workaround, I have since written a startup batch file to perform a
Bootvis optimisation restart on first login. While infinitely better than
having to perform all the tasks manually, it still requires me to log in
before the restart can take place and means I'm looking at AT LEAST seven
minutes after I first turn my computer on before I can continue using it.

I will post the code tomorrow (it's on my home PC) as whatever Bootvis is
doing, it can (I hope) be considered a clean boot so may be useful for others
experiencing slow boot issues.

Thanks,

Ben.
 
B

bonapardo

Hi,

I have posted the contents of three batch files required for the Bootvis
Workaround below. As I said previously, this is not ideal, but provides a
clean boot for me every time without fail. I cannot guarantee this would
work for everyone.

The contents of my D:\Bootvis_Workaround directory are as follows:

Bootvis_Restart.bat - The main batch file, set as a startup script to be run
on every log in.
processes.txt - A text file used to store a list of running proccesses.
Reset_BVWStatus.bat - A batch file, set as a shutdown script, run to change
the workaround status.
Restart_Warning.jpg - A full screen JPEG warning the user a restart is about
to take place.
ScheduledRestart.bat - A batch file which runs Reset_BVWStatus.bat then
Bootvis_Restart.bat. For when a restart must be instigated by a user (using
a shortcut).
status.txt - A text file used for storing the status of the workaround.

PLEASE NOTE THE FOLLOWING IF USING THIS WORKAROUND:

1. Microsoft Bootvis must be installed
2. Bootvis Trace functionality can no longer be used due to the detection of
the Bootvis_Sleep process
3. Requires a warning .jpg - a full screen image
4. All users on the machine are required to have admin access so they can
all run the startup script successfully
5. If a system restart is required, an install for example, automated
restarts should be cancelled and later performed manually by running the
shutdown batch file then the startup script. Creating a shortcut that runs
yet another batch file (ScheduledRestart.bat) makes this easier
6. Path constants in each batch file may have to be changed depending on
where files are stored.
7. Ensure Reset_BVWStatus.bat is set as a shutdown script PRIOR to setting
Bootvis_Restart.bat otherwise a restart will be performed on every log in
rather than every boot.


------------------------Reset_BVWStatus.bat-----------------------------

@ECHO off

REM ** BOOTVIS RESTART WORKAROUND RESTARTS PC ON FIRST LOGIN **
REM ** USING OPTIMISE SYSTEM RESTART. THIS ENSURES QUICK **
REM ** RESTART AND MAXIMUM PERFORMANCE FROM CPU - A CLEAN BOOT **

REM ** This batch file is run on every shutdown to reset the **
REM ** status text file so on next login, the startup batch **
REM ** file will run code to restart the computer **

:BEGIN

REM ** DEFINE CONSTANT FOR FILE PATH TO WORKAROUND FILES **
set BVW_FilePath = D:\Bootvis_Workaround\

REM ** SET STATUS TO OUTSTANDING, SO STARTUP CODE IS **
REM ** RUN ON NEXT LOGIN **
echo OUTSTANDING > %BVW_FilePath%status.txt

:END



------------------------Bootvis_ReStart.bat-----------------------------

@ECHO off

REM ** BOOTVIS RESTART WORKAROUND RESTARTS PC ON FIRST LOG IN **
REM ** USING OPTIMISE SYSTEM RESTART. THIS ENSURES QUICK **
REM ** RESTART AND MAXIMUM PERFORMANCE FROM CPU - A CLEAN BOOT **

REM ** There are a number of points to note **
REM ** 1. Microsoft Bootvis must be installed **
REM ** 2. When using this workaround, Bootvis Trace **
REM ** functionality can no longer be used due to the **
REM ** detection of the Bootvis_Sleep process **
REM ** 3. Requires a warning .jpg - a full screen image **
REM ** 4. Uses a second, one line shut down script to set **
REM ** the status text file to OUTSTANDING. **
REM ** Windows is set up to run the script on shutdown **
REM ** 5. All users on the machine are required to have **
rem ** admin access so they can all run the startup **
REM ** script successfully **
REM ** 6. If a system restart is required, for an install **
REM ** for example, automated restarts should be stopped **
REM ** and later performed manually by running the **
REM ** shutdown batch file then this one. Creating a **
REM ** shortcut that runs yet another batch file **
REM ** (ScheduledRestart.bat) makes this easier **
REM ** 7. The BVW_FilePath constant is the path to where all **
REM ** files required for ths script are stored. Change **
REM ** to a relevant path. Final backslash is required **

:BEGIN

REM ** DEFINE CONSTANT FOR FILE PATH TO WORKAROUND FILES **
set BVW_FilePath = D:\Bootvis_Workaround\

REM ** INSTIGATE DELAY TO ALLOW STARTUP PROCESSES TO BEGIN **
REM ** I.E. THE BOOTVIS_SLEEP PROCESS **
ping 1.1.1.1 -n 1 -w 1000 > null

REM ** LOAD LIST OF RUNNING PROCESSES INTO A TEXT FILE **
%SystemRoot%\system32\pv.exe > %BVW_FilePath%processes.txt

REM ** SEARCH THE STATUS TEXT FILE FOR A STATUS OF OUTSTANDING **
REM ** AN OUTSTANDING STATUS IS SET BY A SHUTDOWN SCRIPT ON **
REM ** EVERY SHUTDOWN **
FIND "OUTSTANDING" %BVW_FilePath%status.txt

REM ** IF A STATUS OF OUTSTANDING IS NOT FOUND, THE STATUS FILE **
REM ** MUST HAVE BEEN SET TO ANOTHER STATUS DURING A CLEAN BOOT **
REM ** THIS IS HERE IN CASE THE STARTUP SCRIPT IS RUN BY A **
REM ** DIFFERENT WINDOWS USER WHEN A CLEAN BOOT HAS ALREADY **
REM ** TAKEN PLACE - WE DON'T WANT TO RESTART ON EVERY LOG IN, **
REM ** JUST THE FIRST **
IF ERRORLEVEL 1 (
REM ** DUMMY LINE **
echo NOT OUTSTANDING
) ELSE (

REM ** SEARCH THE PROCESSES TEXT FILE FOR THE BOOTVIS_SLEEP **
REM ** PROCESS. IF IT IS FOUND, THE PROCESS IS RUNNING, SO **
REM ** AN OPTIMISE SYSTEM RESTART MUST HAVE JUST TAKEN PLACE **
FIND "Bootvis_Sleep.exe" %BVW_FilePath%processes.txt

REM ** IF THE BOOTVIS_SLEEP PROCESS IS NOT FOUND, THE OPTIMISE **
REM ** SYSTEM RESTART HAS NOT YET TAKEN PLACE AND MUST BE PERFORMED **
IF ERRORLEVEL 1 (

REM ** OPEN THE FULL SCREEN JPG WANRING USER RESTART IS **
REM ** ABOUT TO TAKE PLACE **
START %BVW_FilePath%RestartWarning.jpg

REM ** START TO OPTIMISE SYSTEM USING BOOTVIS **
START "TEMP WINDOW" "D:\Program Files\Microsoft Bootvis\BootVis.exe"
-prepsystem

REM ****************************************************************
REM ** THIS SECTION NOT REQUIRED AS SECOND OPTIMISE CALL RESTARTS **
REM ** HOWEVER, KEPT IN FOR CLARITY **
REM ** DELAYS WHILE OPTIMISATION PROCESSES START THEN KILLS THEM **
ping 1.1.1.1 -n 2 -w 1000 > null
TASKKILL /F /IM "bootvis.exe"
TASKKILL /F /IM "defrag.exe"
TASKKILL /F /IM "dfrgntfs.exe"
REM ****************************************************************

REM ** SECOND OPTMIMISATION CALL WILL RESTART SYSTEM **
START "TEMP WINDOW" "D:\Program Files\Microsoft Bootvis\BootVis.exe"
-prepsystem

REM ** OPEN JPG WARNING AGAIN IN CASE IT FALLS BEHIND **
REM ** OTHER WINDOWS**
START %BVW_FilePath%RestartWarning.jpg

REM ** SET STATUS TO HALFWAY. NOT REALLY REQUIRED AS THE RESTART **
REM ** WILL SET THE STATUS TO OUTSTANDING. KEPT HERE IN CASE **
REM ** THERE IS A FAILURE FOR SOME REASON **
echo HALFWAY > %BVW_FilePath%status.txt
) ELSE (

REM ** AN OPTIMISE SYSTEM RESTART HAS JUST TAKEN PLACE, SO **
REM ** THE BOOTVIS SLEEP PROCESS MUST BE KILLED AND IT'S **
REM ** TEMPORARY EXE FILE DELETED FROM THE BOOTVIS DIR **
TASKKILL /F /IM "Bootvis_Sleep.exe"
DEL "D:\Program Files\Microsoft Bootvis\Bootvis_Sleep.exe"

REM ** SET STATUS TO DONE, SO SUBSEQUENT LOG INS DON'T **
REM ** INSTIGATE RESTART **
echo DONE > %BVW_FilePath%status.txt
)
)


:END


------------------------Bootvis_ReStart.bat-----------------------------

@ECHO off

REM ** BOOTVIS RESTART WORKAROUND RESTARTS PC ON FIRST LOGIN **
REM ** USING OPTIMISE SYSTEM RESTART. THIS ENSURES QUICK **
REM ** RESTART AND MAXIMUM PERFORMANCE FROM CPU - A CLEAN BOOT **

REM ** This scheduled restart batch file allows a clean boot **
REM ** to be manually performed by a user. Simply create a **
REM ** shortcut to this file **

:BEGIN

REM ** DEFINE CONSTANT FOR FILE PATH TO WORKAROUND FILES **
set BVW_FilePath = D:\Bootvis_Workaround\

REM ** RUN THE SHUTDOWN BATCH FILE TO SET STATUS TO OUTSTANDING **
START %BVW_FilePath%Reset_BVWStatus.bat

REM ** RUN THE RESTART BATCH FILE TO PERFORM A CLEAN BOOT **
START %BVW_FilePath%Bootvis_Restart.bat

:END


------------------------------------------------------------------------





Regards,

Ben.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

bootvis help 1
Bootvis 6
Bootvis Causes Delay Loading Startup Programs 7
bootvis for x64 Edition? 1
Used BootVis now Can't Boot Up. 2
Bootvis 4
bootvis and recovery install causing problems 2
BootVis advice 1

Top