Jump to content

Wpi.cmd Reboot When Done?


Recommended Posts

Windows does not reboot after WPI is done installing. I call reboot.exe as follows at the end of WPI.cmd. Is this the right way to do it?

REM Special registry tweak needed
regedit /S "%WPIPATH%\common\wpi.reg"

REM Play Audio
CD /D %CDROM%\WPI\common\music\
start %CDROM%\WPI\common\music\UAP.exe

REM Make WPI driectory the current directory
for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:
cd "%WPIPATH%"

REM Start WPI and wait for its end
start /wait WPI.hta

REM call any cleanup code here, or after this script.
tskill UAP
shutdown.exe -r -f -t 5 -c "Reboot in 5 sec..."
exit

:end

Link to comment
Share on other sites


I'm having a similar problem and its only started since adding WPI to my unattended disc.

I have a similar install order to the one you listed with a couple of differences. After WPI has ended I run all the cleanup commands, then call shutdown and last of all delete the %systemdrive%\Install folder. Heres the last chunk of my WPI.cmd:

REGEDIT /S %systemdrive%\Install\regtweaks.reg

ECHO.
ECHO Restarting the PC in 2 minutes...
shutdown.exe -r -f -t 150 -c "Installation of Windows XP Media Center 2005 and extra software is now complete.  Windows will shut down and restart in 2 minutes, 30 seconds to complete the installation."
RD /S /Q "%systemdrive%\Install"
exit

The shutdown command is called just fine but then is seems to hang and will only close and complete properly is I hit Ctrl-Alt-Del and kill cmd.exe. Of course, because the timer has started it reboots anyway and all is well but I then end up with the Windows Classic theme. Whats going on?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...