Preventing Task Sequence Reboot After Software Install which produces a 3010 exit code

This is one that you’ll deal with sooner or later, Windows XP Service Pack 3 is a valid example (requires a reboot after install and therefore produces an exit code of 3010 or 0x80070bc2

Your task sequence will interpret the return code and act upon it by restarting your install before continuing but this may not be your desired result. To get around this you need to wrap the original program in a VBS script (or similar script) which masks the return code and produces a retval of 0 (zero) meaning all is good and no need to reboot.

A very simple example of this is the following code which could be called from within a task sequence and allow the ts to continue even if the returned retval was 3010:

Dim Retval

‘ *** Install Application. ***
Dim WSHShell
Set WSHShell =

‘ open normal
and don’t wait

WSHShell.Run “
notepad.exe“, 1, True
Set WSHShell = Nothing

‘ *** show us
what RETVAL is, unrem to see what retval = ***

  MsgBox “The
actual return code was ” &retval

‘ *** unrem to set to
3010 for testing ***

‘retval = 3010

If retval = 3010

MsgBox “The return code was 3010, resetting to 0”
MsgBox “The actual return code was ” &retval

End If

‘ *** set
the return value to 0 anyway. ***

MsgBox “The
return code was reset to 0”

The sample above is a script for starting your program (notepad.exe in this case but it could be an msi script or whatever), i’ve added Msgbox lines that you can rem out/in to change the behavior of the script, try it out yourself to see the results.




This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.