Jump to content

Including A Pop-up Box?


Recommended Posts

Okay so my WPI is almost perfect yet I now need a pop up box with some text and a yes or no button. This needs to be done BEFORE wpi.hta runs. yes will continue and no will cancel the wpi.hta

Here is my wpi.cmd file (If any one sees any way to clean it up just say what you think.

@ECHO OFF

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:\wpi.ico set CDROM=%%i:

REM If WPI should run off the CD the replace %~dp0 with %CDROM%\PathToWPI
set WPIPATH=%~dp0

"%WPIPATH%\common\cmdow.exe" @ /HID

start /WAIT %WPIPATH%\COMMON\RESOLUTION.EXE

start %WPIPATH%\common\fontinst.exe
regedit /S "%WPIPATH%\common\wpi.reg"

for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:
cd "%WPIPATH%"

start /wait WPI.hta

del /s/q "%Systemdrive%\Documents and Settings\%Username%\Desktop\*.lnk"

del /F %SYSTEMDRIVE%\WPI.CMD

shutdown.exe -r -f -t 10 -c "Reboot in 10 sec..."

exit

:end

Link to comment
Share on other sites


You COULD do it with some vb script:

@ECHO OFF

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:\wpi.ico set CDROM=%%i:

REM If WPI should run off the CD the replace %~dp0 with %CDROM%\PathToWPI
set WPIPATH=%~dp0

"%WPIPATH%\common\cmdow.exe" @ /HID

start /WAIT %WPIPATH%\COMMON\RESOLUTION.EXE

start %WPIPATH%\common\fontinst.exe
regedit /S "%WPIPATH%\common\wpi.reg"

for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:
cd "%WPIPATH%"

echo Dim WshShell, oExec>bla.vbs
echo Set WshShell = CreateObject("WScript.Shell")>>bla.vbs
echo.>>bla.vbs
echo answer = Msgbox("Do you want to run wpi?", VBYesNo)>>bla.vbs
echo if answer = 6 then>>bla.vbs
echo  Set oExec = WshShell.Exec("wpi.hta")>>bla.vbs
echo end if>>bla.vbs
start /wait bla.vbs
del /q bla.vbs

del /s/q "%Systemdrive%\Documents and Settings\%Username%\Desktop\*.lnk"

del /F %SYSTEMDRIVE%\WPI.CMD

shutdown.exe -r -f -t 10 -c "Reboot in 10 sec..."

exit

:end

You can also add a title to the msgbox:

Msgbox("Do you want to run wpi?", VBYesNo, "title here")

Link to comment
Share on other sites

okay, I tested this a lot, and it works from cd. I also improved it a bit :D:

echo Dim WshShell, oExec>%tmp%\bla.vbs
echo Set WshShell = CreateObject("WScript.Shell")>>%tmp%\bla.vbs
echo answer = Msgbox("Do you want to run wpi?", VBYesNo)>>%tmp%\bla.vbs
echo if answer = 6 then>>%tmp%\bla.vbs
echo oExec = WshShell.Run("wpi.hta", 1, true)>>%tmp%\bla.vbs
echo end if>>%tmp%\bla.vbs
echo set WshShell = nothing>>%tmp%\bla.vbs
%tmp%\bla.vbs
del /q %tmp%\bla.vbs

Ow, yeah. An advantage of this code above that autoIt based thing: you don't need autoIt installed, or need to have to be dependand of some extra exe stored somewhere.

edit:

for those wondering, there is no need for 'start /wait' because the 'true' in the wshshell.run command makes it wait till the app has finished.

Link to comment
Share on other sites

SWEEEEEEET !!!!!!!!!!!!!!!! Excaxtly what I want !!!

And my box is waaaaaay to wide how do I denote line breaks?

PERFECT!!!!!

echo Dim WshShell, oExec>%tmp%\bla.vbs

echo Set WshShell = CreateObject("WScript.Shell")>>%tmp%\bla.vbs

echo answer = Msgbox("At times during the install proccess some of the programs will use the cursor and answer the boxes automatically. So it is suggested that you start WPI and then leave your PC alone untill the installation process is complete. The system will reboot to complete the installation. Do you wish to continue?",VBYesNo,"Windows Post Install Wizard")>>%tmp%\bla.vbs

echo if answer = 6 then>>%tmp%\bla.vbs

echo oExec = WshShell.Run("wpi.hta", 1, true)>>%tmp%\bla.vbs

echo end if>>%tmp%\bla.vbs

echo set WshShell = nothing>>%tmp%\bla.vbs

%tmp%\bla.vbs

del /q %tmp%\bla.vbs

Just want to make the box so it is nowhere near as wide.

Can I make yes run %wpipath%\common\VideoChanger.exe 1280x1024x32@85 -q

and then wpi.hta??

Edited by kelsenellenelvian
Link to comment
Share on other sites

sure.

everywhere where you want it to go to a new line (to make the box less wide) put a vbCRLF like this:

Msgbox("At times during the install proccess some of the programs will use the cursor" + vbCRLF + "and answer the boxes automatically. So it is suggested that you start WPI and then" + vbCRLF + "leave your PC alone untill the installation process is complete. The system will reboot to" + vbCRLF + "complete the installation. Do you wish to continue?",VBYesNo,"Windows Post Install Wizard")

for that resolution changer, add this line before the wshshell.run command that starts wpi:

echo oExec = WshShell.Run("common\VideoChanger.exe 1280x1024x32@85 -q", 1, true)>>%tmp%\bla.vbs

Link to comment
Share on other sites

for that resolution changer, add this line before the wshshell.run command that starts wpi:

echo oExec = WshShell.Run("common\VideoChanger.exe 1280x1024x32@85 -q", 1, true)>>%tmp%\bla.vbs

The line breaks worked perfectly but it did no run the res changer. Any ides?

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