@ECHO OFF
TITLE GUI - RunOnce // Setup
PUSHD "%~dp0"

ECHO                                       \./
ECHO                                      (o o)
ECHO ---------------------------------oOOo-(_)-oOOo---------------------------------
ECHO Over the next few minutes you will see automated installations
ECHO of various Sofware Applications and Settings being implemented.
ECHO ===============================================================================
ping -n 3 localhost 1> NUL


ECHO.
ECHO Setting "Password never expires" for the User Account "Owner"...
WMIC path Win32_UserAccount where Name="Owner" set PasswordExpires=false 1> NUL

ECHO.
ECHO Installing MF4SBF Patch...
XCOPY "Scripts\Microsoft .NET Framework v4 - Slow Windows XP Boot Fix.vbs" "%AllUsersProfile%\Start Menu\Programs\Startup\" /V /Y 1> NUL

ECHO.
ECHO Setting a Default Internet Explorer Start Page...
REG ADD "HKCU\Software\Microsoft\Internet Explorer\Main" /v "Start Page" /t REG_SZ /d "http://www.zone54.com/" /f 1> NUL

IF NOT EXIST "%SystemDrive%\DPsFnshr.exe" GOTO SKIP
ECHO.
ECHO Executing DriverPacks Finisher...
START "" /WAIT "%SystemDrive%\DPsFnshr.exe"
:SKIP

ECHO.
ECHO Executing Options Selector Script...
START "" /WAIT "Scripts\Windows XP Black Edition - Options Selector.hta"

for /f "usebackq delims=|" %%f in (`dir /B "%SystemDrive%\Documents and Settings\WinXP_BE\Settings\*.cmd" 2^> NUL`) do (GOTO YES)
GOTO SKIP
:YES
ECHO.
ECHO Copying file "New User Account Settings.cmd"...
XCOPY "New User Account Settings.cmd" "%SystemDrive%\Documents and Settings\WinXP_BE\" /V /Y 1> NUL
ECHO Adding Registry Key to the Default "NTUSER.DAT" file to run the file
ECHO "New User Account Settings.cmd" once on every new created user account...
REG LOAD "HKU\TempHive" "%SystemDrive%\Documents and Settings\Default User\NTUSER.DAT" 1> NUL
REG ADD "HKU\TempHive\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "New User Account Settings" /t REG_EXPAND_SZ /d "\"%%SystemDrive%%\Documents and Settings\WinXP_BE\New User Account Settings.cmd\"" /f 1> NUL
REG UNLOAD "HKU\TempHive" 1> NUL
:SKIP

ECHO.
ECHO Adding Registry Key that starts the "Regional and Language Options" and
ECHO "Date and Time" menu after the completion of the Windows XP installation...
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "Regional and Language Options" /t REG_SZ /d "CONTROL international" /f 1> NUL
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "Date and Time" /t REG_SZ /d "CONTROL date/time" /f 1> NUL


ECHO.
ECHO --------Finished----------Finished----------Finished----------Finished--------
ECHO.
ECHO Windows XP Installation is Finished. Computer will now Restart in 30 seconds.
ECHO.
ECHO --------Finished----------Finished----------Finished----------Finished--------
ping -n 3 localhost 1> NUL
SHUTDOWN -r -f -t 27 -c "     Windows XP Installation is Finished.            ----------------------------------------------------------       You can now remove the Windows XP Disc from the Optical Disc Drive.                  Computer is preparing to restart..."
EXIT
