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.

Adding Additional Variables To Be Used With Wpi?

Featured Replies

What would be the best way to add additional variables to be used with WPI?

@durex I don't know about anybody else, but I'm a little confused by the question: not sure what is meant by "add additional variables." Can you provide an example of what you are trying to accomplish? Thanks.

  • Author

Sure can...

In my RunOnceEx script, to save on some typing, I would create additional variables to be used throughout the script..

ie:

APPS = %CDROM%\Custom\Applications
REG =  %CDROM%\Custom\Registry
SYSTEM = %CDROM%\Custom\System
RESTORE = D:\!Personal!\SystemBackup

This way when Im inputting execute / install lines throughout runonceex, I can simply use these variables instead of having to type out the entire path every time....

Now, after pawing through the js files, I think Ive figured it out... if someone could verify my work here, Id greatly appreciate it as vbscript is my scripting language of choice.. not JS...

In the 'generate.js' file I found the following section which looks like it converts system variables to ones to be used throughout WPI...

function replpath(u) {  
position = "generate.js";
cddrv = FindCDRom();
sysdrv = WshEnv("SYSTEMDRIVE") + "\\";
.....

As well as this section...

rs = rs.replace(/%cdrom%/gi, cddrv); 	 
rs = rs.replace(/%systemdrive%/gi,sysdrv);
rs = rs.replace(/%windir%/gi, windir);  
.......

So I made the following additions to allow the use of my variables..

apps = cddrv + "Custom\\Applications\\";
network = cddrv + "Custom\\Network\\";
reg = cddrv + "Custom\\Registry\\";
restore = "D:\\!Personal!\\SystemBackup\\";
system = cddrv + "Custom\\System\\";

and

rs = rs.replace(/%apps%/gi, appdata)	
rs = rs.replace(/%network%/gi, network)
rs = rs.replace(/%reg%/gi, reg)
rs = rs.replace(/%restore%/gi, restore)
rs = rs.replace(/%system%/gi, system)

Ive only tested it with an absolute path (C:\Temp), I havent tested the "cddrv +", lines, but it appears as though it should work...

Make sense?

  • Author

I dont mean for this to sound offensive in any way, but didnt you design this or am I mistaken?

hasi and other people before him dit it. kelsenellenelvian is improving wpi on other parts than that.

Make sense?
Makes perfect sense to me now, durex, but I'm no programmer. :P Maybe play with it, try it out, and post back...unless hasi001 or others have an idea?

It shouldn't cause any problems.

I've added the %temp% variable in there.

And also, i've added a few commands in "substituteCommand".

Namely DELETE and MAKEDIR.

  • 1 month later...

I have created a System variable on the XP client like this:

Variable = apps

Value = \\dc01\apps

And in the generate.js i added this:

Under the function replpath(u) add:

apps = WshEnv("apps") + "\\";

rs = rs.replace(/%apps%/gi, apps);

Best regards

Erling Johansen

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.