November 30, 200520 yr What I would like to be able to do is pass in a parameter when I execute the .hta file.wpi.hta schoolwould be equivalent to opening wpi.hta and selecting "school" from the Selections drop down.All the items in the config file that have this would be checked:configs[pn]=['school']Does WPI support this right now or would it be easy enough to hack?Thanks!
December 1, 200520 yr Author I figured it out.Add these lines to WPI.hta:<script language="javascript"> var params = oApp.commandLine.split(" "); var wpiparam=params[params.length - 1]; if( wpiparam!='' ) load_checks = params[params.length - 1];</script>
December 3, 200520 yr NICE !but , if you write WPI to a CD media , what is the difference for youbetween this and checking <school on load> in options .permanently you will have <school> checked on load .i think maybe i dont understand your point ?
December 7, 200520 yr Author I am creating a multi-boot DVD with multiple WINNT.SIF files. Each one will have a different [GuiRunOnce] section that will be loading different applications.
December 20, 200520 yr Nicely done, i implemented the code to my WPI and works great. But what if i would like to trigger the installation automatically with parameter, can that be done?i.e. i type in commandline "wpi.hta school install" and then wpi checks school and automagically triggers install action??EDIT: Figured it out:<script language="javascript"> var params = oApp.commandLine.split(" "); var wpiparam=params[params.length - 1]; if( wpiparam!='' ) { load_checks = params[params.length - 1]; timer = 'on'; secs = '5'; }</script> Edited December 20, 200520 yr by cribban
December 21, 200520 yr How much have you tested this?I want to include commandlines in the next release.Also where in WPI.hta did you add that section.
December 21, 200520 yr I have 9 different configurations, i've tested so far with 5 of them and it worked flawlessly. I do not see any problems with using parameter. I added the parameter code, right after the timers.js and before the handleerrors script. When looking at wpi.hta (from version 4.3.5) i added the code at line 111I'm using WPI for network install here at work and am very happy with it, thanks to your hard work kelsenellenelvian!
December 21, 200520 yr So you are calling it like so:start /wait %windir%\system32\mshta.exe "%CD%\wpi.hta school"
December 21, 200520 yr Keep in mind, it is case-sensitive, it has to be typed in exactly as it is written in the configuration files. Maybe it can be done so it is not case-sensitive
December 21, 200520 yr @ cribbon could you modify it so the timer can be set in the commandline please?
December 21, 200520 yr This should do the trick, with this code you can type in "wpi.hta School 20" and it will select School and set timer to 20 seconds:<script language="javascript"> var params = oApp.commandLine.split(" "); var wpiparam=params[params.length - 2]; var timeparams = oApp.commandLine.split(" "); var wpitimeparam=timeparams[timeparams.length - 1]; if( wpiparam!='',wpitimeparam!='' ) { load_checks = params[params.length - 2]; timer = 'on'; secs = timeparams[params.length - 1]; }</script>
Create an account or sign in to comment