Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Does WPI support parameters to the .hta file?

Featured Replies

What I would like to be able to do is pass in a parameter when I execute the .hta file.

wpi.hta school

would 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!

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

NICE !

but , if you write WPI to a CD media , what is the difference for you

between this and checking <school on load> in options .

permanently you will have <school> checked on load .

i think maybe i dont understand your point ?

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

  • 2 weeks later...

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 by cribban

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 111

I'm using WPI for network install here at work and am very happy with it, thanks to your hard work kelsenellenelvian! :thumbup

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

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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.