wpi.cmd @ECHO OFF REM Example, how to look for CDROM-drive. Must have WPI.ico at the root of the CD. for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\win51ip.SP2 set CDROM=%%i: echo Found CD-Rom as drive %CDROM% REM Determine the WPI startup path. REM if wpi should run off the cd the replace %~dp0 with %cdrom%. set wpipath=%CDROM%\WPI\ REM Hide this command window. %wpipath%Tools\cmdow.exe @ /hid REM Special registry tweak needed. regedit /s %wpipath%common\wpi.reg REM Start WPI and wait for its end start /wait %wpipath%wpi.hta REM Undo registry tweak. regedit /s %wpipath%common\undo.reg REM Rebooting the sytem to finalize the installation process. REM shutdown.exe -r -f -t 30 -c "To finish installations WPI will now reboot in 30 sec..." exit :end runonceex.cmd cmdow @ /HID @Echo Off FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\win51ip.SP2 SET CDROM=%%i: SET PP=%cdrom%\WPI\ SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY%\001 /V 1 /D "%PP%WPI.cmd" /f EXIT o and also since those errors pop up the computer doesnt restart itself.i need it to restart itself!