Jump to content

Recommended Posts

Posted (edited)

Lawrenca, Doc Symbiosis, Kels, and myself have been talking about updating WPI.cmd to remove some clutter and find a better CD check. This is what I have come up with.

It uses all the existing code, just in a different manner. It scans the %~dp0 to find the %wpipath%, nothing new. But it sets %drive% to just the drive name, ie, C:, D:, E:, W:, etc. This would be used as the cdrom if launched from cd/dvd.

If %drive% is actually a harddrive, then you have to change the paths accordingly. The only one in my WPI.cmd would be the clean up script. As is, if you launched it from hd, the file would not be found. No big deal. No error message, no abort. If it was launched from cd, it will run the script.

@ECHO OFF

REM Determine startup path and drive letter.
for /f "delims=: tokens=1" %%i in ("%~dp0") do set drive=%%i:
set wpipath=%~dp0
%wpipath%\Tools\cmdow.exe @ /hid

REM Force resolution to needed size for wpi interface.
REM %wpipath%\Tools\ResChange.exe -width=1280 -height=1024 -depth=max -refresh=max

REM Font installation - the smooth and customizable way.
REM start /wait %wpipath%\Tools\Fonts\FontInstaller.exe

REM Special registry tweak needed.
regedit /s %wpipath%\Common\WPI.reg

REM Start WPI and wait for it to end.
%wpipath%\WPI.hta

REM Undo registry tweak.
regedit /s %wpipath%\Common\Undo.reg

REM Clean up script.
REM %drive%\$OEM$\CleanUp.cmd

REM Rebooting the sytem to finalize the installation process.
REM shutdown.exe -r -f -t 60 -c "To finish installations WPI will now reboot in 60 sec..."

exit

I like the "less is more" thinking for scripts like this.

Edited by mritter

Posted

This is my RunOnceEx.cmd file with similar updates:

cmdow @ /HID
@ECHO OFF

for /f "delims=: tokens=1" %%i in ("%~dp0") do set drive=%%i:
set wpipath=%drive%\install\wpi

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY%\001 /V 1 /D "%wpipath%\WPI.cmd" /f

EXIT

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...