Kelsenellenelvian Posted March 16, 2005 Share Posted March 16, 2005 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.htaHere is my wpi.cmd file (If any one sees any way to clean it up just say what you think.@ECHO OFFfor %%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%\PathToWPIset WPIPATH=%~dp0"%WPIPATH%\common\cmdow.exe" @ /HIDstart /WAIT %WPIPATH%\COMMON\RESOLUTION.EXEstart %WPIPATH%\common\fontinst.exeregedit /S "%WPIPATH%\common\wpi.reg"for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:cd "%WPIPATH%"start /wait WPI.htadel /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 More sharing options...
djbe Posted March 16, 2005 Share Posted March 16, 2005 You COULD do it with some vb script:@ECHO OFFfor %%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%\PathToWPIset WPIPATH=%~dp0"%WPIPATH%\common\cmdow.exe" @ /HIDstart /WAIT %WPIPATH%\COMMON\RESOLUTION.EXEstart %WPIPATH%\common\fontinst.exeregedit /S "%WPIPATH%\common\wpi.reg"for /F "delims=: tokens=1" %%i in ("%WPIPATH%") DO %%i:cd "%WPIPATH%"echo Dim WshShell, oExec>bla.vbsecho Set WshShell = CreateObject("WScript.Shell")>>bla.vbsecho.>>bla.vbsecho answer = Msgbox("Do you want to run wpi?", VBYesNo)>>bla.vbsecho if answer = 6 then>>bla.vbsecho Set oExec = WshShell.Exec("wpi.hta")>>bla.vbsecho end if>>bla.vbsstart /wait bla.vbsdel /q bla.vbsdel /s/q "%Systemdrive%\Documents and Settings\%Username%\Desktop\*.lnk"del /F %SYSTEMDRIVE%\WPI.CMDshutdown.exe -r -f -t 10 -c "Reboot in 10 sec..."exit:endYou 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 More sharing options...
Kelsenellenelvian Posted March 16, 2005 Author Share Posted March 16, 2005 tried that but when used the no option still ran wpi.Plus would that work on cd? Link to comment Share on other sites More sharing options...
djbe Posted March 17, 2005 Share Posted March 17, 2005 okay, I tested this a lot, and it works from cd. I also improved it a bit :echo Dim WshShell, oExec>%tmp%\bla.vbsecho Set WshShell = CreateObject("WScript.Shell")>>%tmp%\bla.vbsecho answer = Msgbox("Do you want to run wpi?", VBYesNo)>>%tmp%\bla.vbsecho if answer = 6 then>>%tmp%\bla.vbsecho oExec = WshShell.Run("wpi.hta", 1, true)>>%tmp%\bla.vbsecho end if>>%tmp%\bla.vbsecho set WshShell = nothing>>%tmp%\bla.vbs%tmp%\bla.vbsdel /q %tmp%\bla.vbsOw, 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 More sharing options...
Kelsenellenelvian Posted March 18, 2005 Author Share Posted March 18, 2005 Looks good will try it. Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted March 18, 2005 Author Share Posted March 18, 2005 (edited) 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.vbsecho Set WshShell = CreateObject("WScript.Shell")>>%tmp%\bla.vbsecho 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.vbsecho if answer = 6 then>>%tmp%\bla.vbsecho oExec = WshShell.Run("wpi.hta", 1, true)>>%tmp%\bla.vbsecho end if>>%tmp%\bla.vbsecho set WshShell = nothing>>%tmp%\bla.vbs%tmp%\bla.vbsdel /q %tmp%\bla.vbsJust 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 March 18, 2005 by kelsenellenelvian Link to comment Share on other sites More sharing options...
djbe Posted March 19, 2005 Share Posted March 19, 2005 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 More sharing options...
Kelsenellenelvian Posted March 19, 2005 Author Share Posted March 19, 2005 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.vbsThe line breaks worked perfectly but it did no run the res changer. Any ides? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now