twrizzo Posted October 27, 2006 Share Posted October 27, 2006 I want to be able to select the applications that are installed using a simple batch file using the choice command. During the cmdlines.txt portion of Windows setup I prompt the user with a choice as to which apps they want to install. The batch file times out after a couple of minutes and only adds the required software to the RunOnceEx.I also add another batch file to the RunOnceEx to prompt the user again as to what software they want installed so that at the end of the RunOnceEx it will prompt them again and update the RunOnceEx with the additional registry entries.The problem that I am having is that if I add to the RunOnceEx during its execution, the title portion gets erased when it finishes and the additional commands are not executed.Is there an easier way to update the RunOnceEx?Any help would be greatly appreciated! Link to comment Share on other sites More sharing options...
Yzöwl Posted October 27, 2006 Share Posted October 27, 2006 Don't be shy then, lets see what you've got so far! Link to comment Share on other sites More sharing options...
twrizzo Posted October 27, 2006 Author Share Posted October 27, 2006 I figured it out. If I have it timeout in my original batch file and install the default apps, I have to insert a new batch file in the RunOnceEx at a lower number than at the point at which it was executed in the original RunOnceEx.For example if I Install apps in the RunOnceEx at keys 10, 20 and 30 and I want to prompt the user with with another batch file at the next logon, I have to put it in a key less than 10 or else it will be executed after the command in RunOnceEx key 30 is.Each of the addition batch files, AllRunonceEx, MISRunonceEX, and PCRunonceEx all have their own individual RunOnceEx settings.cmdlines.txt[COMMANDS]"useraccounts.cmd""Run-Once.cmd"Run-Once.cmd@echo offcolor 1ftitle New Computer Setupecho.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º New Computer ºecho º ºecho º October 27, 2006 ºecho º ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Choose an option to automatically install ºecho º all of your applications on next reboot. ºecho º ºecho º L - Laptop ºecho º M - MIS Laptop ºecho º P - Standard PC ºecho º T - Timeout - Will prompt again ºecho º X - Do not install any software ºecho º ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼecho.choice /C:LMPTX /T:T,300IF ERRORLEVEL == 5 GOTO EXITIF ERRORLEVEL == 4 GOTO TIMEOUTIF ERRORLEVEL == 3 GOTO PCIF ERRORLEVEL == 2 GOTO MISIF ERRORLEVEL == 1 GOTO LAPTOP:LAPTOPEcho Running LAPTOP RunOnceExTitle Laptop Setupcmdow /run /hid C:\install\AllRunOnceEx.cmdcmdow /run /hid C:\install\LaptopRunOnceEx.cmdcolor 5fclsecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º LAPTOP SETUP ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Your apps will be installed the next time you log on. ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3rem cmdow /run /hid C:\install\Prompt_for_CD.vbsGoto Exit:MISEcho Running MIS LAPTOP RunOnceExTitle MIS Laptop Setupcolor D1clsecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º MIS LAPTOP SETUP ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Your apps will be installed the next time you log on. ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3rem cmdow /run /hid C:\install\Prompt_for_CD.vbscmdow /run /hid C:\install\AllRunOnceEx.cmdcmdow /run /hid C:\install\MISRunOnceEx.cmdGoto Exit:PCEcho Running PC RunOnceExTitle PC Setupcolor 2fclsecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º PC SETUP ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Your apps will be installed the next time you log on. ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3rem cmdow /run /hid C:\install\Prompt_for_CD.vbscmdow /run /hid C:\install\AllRunOnceEx.cmdcmdow /run /hid C:\install\PCRunOnceEx.cmdGoto Exit:TIMEOUTclsTitle No Install Selectedcolor E0echo.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º No Install Selected ºecho º Installing Default Applications ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º You will be prompted again on next logon ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3cmdow /run /hid C:\install\AllRunOnceEx.cmdcmdow /run /hid reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /v "TITLE" /t REG_SZ /d "Installing Programs" /frem ****************************************************************************************I add the batch file to prompt the user for what software they want at the end of the already executing RunOnceEXcmdow /run /hid reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\999" /v "Run-Once" /t REG_SZ /d "C:\Install\Run-Once2.cmd" /frem ***************************************************************************************Goto Exit:QUITclsTitle Quittingcolor CFecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º QUITTING ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹Sleep 3Goto Exit:EXITExitRun-Once2.cmd@echo offcolor 4ftitle New Computer Setupecho.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º New Computer ºecho º ºecho º October 27, 2006 ºecho º ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Choose an option to automatically install ºecho º all of your applications on next reboot. ºecho º ºecho º L - Laptop ºecho º M - MIS Laptop ºecho º P - Standard PC ºecho º T - Timeout - Will prompt again ºecho º X - Do not install any software ºecho º ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼecho.choice /C:LMPTXIF ERRORLEVEL == 5 GOTO EXITIF ERRORLEVEL == 4 GOTO TIMEOUTIF ERRORLEVEL == 3 GOTO PCIF ERRORLEVEL == 2 GOTO MISIF ERRORLEVEL == 1 GOTO LAPTOP:LAPTOPrem Echo Running LAPTOP RunOnceExTitle Laptop Setupcolor 5fclsecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º LAPTOP SETUP ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Your apps will be installed the next time you log on. ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3rem cmdow /run /hid C:\install\Prompt_for_CD.vbscmdow /run /hid C:\install\LaptopRunOnceEx.cmdGoto Exit:MISrem Echo Running MIS LAPTOP RunOnceExTitle MIS Computer Setupcolor D1clsecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º MIS COMPUTER SETUP ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Your apps will be installed the next time you log on. ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3rem cmdow /run /hid C:\install\Prompt_for_CD.vbscmdow /run /hid C:\install\MISRunOnceEx.cmdcmdow /run /hid C:\install\Log-Off.vbsGoto Exit:PCrem Echo Running PC RunOnceExTitle Standard PC Setupcolor 2fclsecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º STANDARD PC SETUP ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º Your apps will be installed the next time you log on. ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3rem cmdow /run /hid C:\install\Prompt_for_CD.vbscmdow /run /hid C:\install\PCRunOnceEx.cmdcmdow /run /hid C:\install\Log-Off.vbsGoto Exit:TIMEOUTcmdow @ /HIDcmdow /run /hid reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /v "TITLE" /t REG_SZ /d "Installing Programs" /frem *************************************************************************************I add the batch file to prompt the user for what software they want at the beginning of the RunOnceEXcmdow /run /hid reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\001" /v "Run-Once" /t REG_SZ /d "C:\Install\Run-Once2.cmd" /frem *************************************************************************************clsTitle No Install Selectedcolor E0echo.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º No Install Selected ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹echo º ºecho º You will be prompted again on next logon ºecho º ºecho ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼSleep 3Goto Exit:QUITclsTitle Quittingcolor CFecho.echo.echo.echo.echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»echo º ºecho º QUITTING ºecho º ºecho ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹Sleep 3Goto Exit:EXITExit Link to comment Share on other sites More sharing options...
Plamdi Posted October 29, 2006 Share Posted October 29, 2006 cmdow /run /hid reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /v "TITLE" /t REG_SZ /d "Installing Programs" /fThere is no reason to use cmdow for this, instead use:reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx" /v "TITLE" /t REG_SZ /d>nul 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