Jump to content

Recommended Posts


Posted

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

Posted

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?

Posted
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?
Posted

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...