myemail7 Posted November 30, 2005 Posted November 30, 2005 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!
Kelsenellenelvian Posted November 30, 2005 Posted November 30, 2005 No it doesn't support switches and as for me I can't get that figured out.
myemail7 Posted December 1, 2005 Author Posted December 1, 2005 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>
oneless Posted December 3, 2005 Posted December 3, 2005 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 ?
myemail7 Posted December 7, 2005 Author Posted December 7, 2005 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.
cribban Posted December 20, 2005 Posted December 20, 2005 (edited) 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, 2005 by cribban
Kelsenellenelvian Posted December 21, 2005 Posted December 21, 2005 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.
cribban Posted December 21, 2005 Posted December 21, 2005 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!
Kelsenellenelvian Posted December 21, 2005 Posted December 21, 2005 So you are calling it like so:start /wait %windir%\system32\mshta.exe "%CD%\wpi.hta school"
Kelsenellenelvian Posted December 21, 2005 Posted December 21, 2005 With your modifications the timer is set yet nothing is checked for me.
cribban Posted December 21, 2005 Posted December 21, 2005 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
Kelsenellenelvian Posted December 21, 2005 Posted December 21, 2005 PERFECT!!! Thanks m8 works beautifully and can even select the All option.
Kelsenellenelvian Posted December 21, 2005 Posted December 21, 2005 @ cribbon could you modify it so the timer can be set in the commandline please?
cribban Posted December 21, 2005 Posted December 21, 2005 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>
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