Kaseya Community

Reboot to Safe Mode XP SP3

  • Did anyone try this yet? Looks like it doesn't work after SP3 is installed. I get a VBS Error. Thoughts??

    Legacy Forum Name: Reboot to Safe Mode XP SP3,
    Legacy Posted By Username: jpyzowski
  • Script Name: Boot to Safe Mode XP
    Script Description: Boot To safe mode XP. This will copy the boot.ini to get file directory on K-server. It will then set registry keys to allow K-agent to start in Safe Mode, Then it will reboot the computer into safe mode.

    IF True
    THEN
    Get File
    Parameter 1 : c:\boot.ini
    Parameter 2 : boot.ini
    Parameter 3 : 1
    OS Type : 0
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\WinVNC4\
    Parameter 2 : Service
    Parameter 3 : REG_SZ
    OS Type : 0
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\KaseyaAgent\
    Parameter 2 : Service
    Parameter 3 : REG_SZ
    OS Type : 0
    Execute Shell Command
    Parameter 1 : bootcfg /Raw "/safeboot:network /sos /bootlog /noguiboot" /id 1
    Parameter 2 : 1
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE








    Script Name: Normal Boot XP
    Script Description: Boot Xp back to Normal Mode.

    IF True
    THEN
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\WinVNC4\
    Parameter 2 : Service
    Parameter 3 : REG_SZ
    OS Type : 0
    Set Registry Value
    Parameter 1 : HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\KaseyaAgent\
    Parameter 2 : Service
    Parameter 3 : REG_SZ
    OS Type : 0
    Execute Shell Command
    Parameter 1 : bootcfg /Raw "/noexecute=optin /fastdetect" /id 1
    Parameter 2 : 1
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: jpyzowski
  • http://community.kaseya.com/xsp/f/28/t/6504.aspx

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: smbtechnology
  • <?xml version="1.0" encoding="ISO-8859-1" ?>
    <folderDef0 id="75520641" name="Reboot to Safe Mode">
      <scriptDef id="78467775" name="Reboot to Safe Mode - TEST first!">
        <scriptIf ifFunc="1" fp1="" fp2="" fp3="" ifTest="0" testVal="" scriptType="0" description="** ENSURE YOU HAVE FULLY TESTED THIS SCRIPT. **   This script will initiate a reboot and force the system to load into SAFE mode. Works for Windows 2000 and Windows XP.  Execute Reboot to normal mode to have the system boot to windows normally. THOROUGHLY test this script before running it on any production system.  Thanks to "Outfishin" aka Chris and "Nziegler" / Nick on the Kaseya customer Forum! " />
        <scriptThenElse teType="0" stepNum="1" teFunc="26" fp1="10" fp2="" fp3="temp" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="2" teFunc="26" fp1="0" fp2="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AgentMon.Exe\Path" fp3="installpath" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="3" teFunc="5" fp1="#temp#SafeModeBoot.vbs" fp2="VSASharedFiles\SafeModeBoot.vbs" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="4" teFunc="5" fp1="#temp#safemode_reboot_kausrtsk.reg" fp2="VSASharedFiles\safemode_reboot_kausrtsk.reg" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="5" teFunc="5" fp1="#temp#safemode_reboot_kausrtskwin2k.reg" fp2="VSASharedFiles\safemode_reboot_kausrtskwin2k.reg" fp3="" osType="3" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="6" teFunc="5" fp1="#temp#instsrv.exe" fp2="VSASharedFiles\instsrv.exe" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="7" teFunc="20" fp1="#temp#instsrv.exe "KaUsrTsk" #installpath#kausrtsk.exe" fp2="1" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="8" teFunc="20" fp1="regedit.exe /s "#temp#safemode_reboot_kausrtsk.reg"" fp2="1" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="9" teFunc="20" fp1="regedit.exe /s "#temp#safemode_reboot_kausrtskwin2k.reg"" fp2="1" fp3="" osType="3" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="10" teFunc="20" fp1="wscript "#temp#SafeModeBoot.vbs"" fp2="1" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="11" teFunc="3" fp1="#temp#safemode_reboot_kausrtsk.reg" fp2="" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="12" teFunc="3" fp1="#temp#safemode_reboot_kausrtskwin2k.reg" fp2="" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="13" teFunc="3" fp1="#temp#SafeModeBoot.vbs" fp2="" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="14" teFunc="18" fp1="" fp2="" fp3="" osType="0" contOnFail="0" />
      </scriptDef>
      <scriptDef id="89245750" name="Reboot to Normal Mode - TEST first! ">
        <scriptIf ifFunc="1" fp1="" fp2="" fp3="" ifTest="0" testVal="" scriptType="0" description="** ENSURE YOU HAVE FULLY TESTED THIS SCRIPT. Kaseya is not responsible for issues caused by its execution **   Use this script after you have executed Reboot to Safe Mode to get the system booting into Windows normally again.  Works for Windows 2000 and XP" />
        <scriptThenElse teType="0" stepNum="1" teFunc="26" fp1="10" fp2="" fp3="temp" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="2" teFunc="5" fp1="#temp#SafeModeNormal.vbs" fp2="VSASharedFiles\SafeModeNormal.vbs" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="3" teFunc="20" fp1="wscript "#temp#SafeModeNormal.vbs"" fp2="1" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="4" teFunc="3" fp1="#temp#SafeModeNormal.vbs" fp2="" fp3="" osType="0" contOnFail="0" />
        <scriptThenElse teType="0" stepNum="5" teFunc="18" fp1="" fp2="" fp3="" osType="0" contOnFail="0" />
      </scriptDef>
    </folderDef0>

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: gopinath.jayakumar


    [edited by: Brendan Cosgrove at 12:56 PM (GMT -8) on 12-13-2010] .
  • Holy Smokes.... code tags please...

    heres mine, works for xp and vista (32bit) havent tried it on anything 64 bit yet


    Script Name: XP Reboot to Safe Mode
    Script Description: Reboot to Safe Mode

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : temp
    OS Type : 0
    Get Variable
    Parameter 1 : 0
    Parameter 2 : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\AgentMon.Exe\Path
    Parameter 3 : installpath
    OS Type : 0
    Write File
    Parameter 1 : #temp#\SafeModeBootAdjust.vbs
    Parameter 2 : VSASharedFiles\BootSafeMode\SafeModeBootAdjust.vbs
    OS Type : 0
    Write File
    Parameter 1 : #temp#\safemode_reboot_kausrtsk.reg
    Parameter 2 : VSASharedFiles\BootSafeMode\safemode_reboot_kausrtsk.reg
    OS Type : 0
    Write File
    Parameter 1 : #temp#\safemode_reboot_kausrtskwin2k.reg
    Parameter 2 : VSASharedFiles\BootSafeMode\safemode_reboot_kausrtskwin2k.reg
    OS Type : 3
    Write File
    Parameter 1 : #temp#\instsrv.exe
    Parameter 2 : VSASharedFiles\BootSafeMode\instsrv.exe
    OS Type : 0
    Pause Script
    Parameter 1 : 30
    OS Type : 0
    Execute Shell Command
    Parameter 1 : #temp#\instsrv.exe "KaUsrTsk" #installpath#\kausrtsk.exe
    Parameter 2 : 1
    OS Type : 0
    Execute Shell Command
    Parameter 1 : regedit.exe /s "#temp#\safemode_reboot_kausrtsk.reg"
    Parameter 2 : 0
    OS Type : 0
    Execute Shell Command
    Parameter 1 : regedit.exe /s "#temp#\safemode_reboot_kausrtskwin2k.reg"
    Parameter 2 : 0
    OS Type : 3
    Execute Shell Command
    Parameter 1 : wscript "#temp#\SafeModeBootAdjust.vbs"
    Parameter 2 : 1
    OS Type : 0
    Delete File
    Parameter 1 : #temp#\safemode_reboot_kausrtsk.reg
    OS Type : 0
    Delete File
    Parameter 1 : #temp#safemode_reboot_kausrtskwin2k.reg
    OS Type : 0
    Delete File
    Parameter 1 : #temp#\SafeModeBootAdjust.vbs
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE


    and back to normal


    Script Name: XP Reboot to Normal Mode
    Script Description: Reboot to normal from safe mode

    IF True
    THEN
    Get Variable
    Parameter 1 : 10
    Parameter 2 :
    Parameter 3 : temp
    OS Type : 0
    Write File
    Parameter 1 : #temp#\SafeModeNormalAdjust.vbs
    Parameter 2 : VSASharedFiles\BootSafeMode\SafeModeNormalAdjust.vbs
    OS Type : 0
    Pause Script
    Parameter 1 : 30
    OS Type : 0
    Execute Shell Command
    Parameter 1 : wscript "#temp#\SafeModeNormalAdjust.vbs"
    Parameter 2 : 1
    OS Type : 0
    Delete File
    Parameter 1 : #temp#\SafeModeNormalAdjust.vbs
    OS Type : 0
    Reboot
    OS Type : 0
    ELSE


    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty
  • Do you have those VBS/Reg files?

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: datacube
  • safemode_reboot.zip
    datacube
    Do you have those VBS/Reg files?


    Sorry about that,
    Find attached all files that are refered

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty