March 28, 200521 yr @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.
March 29, 200521 yr 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\ApplicationsREG = %CDROM%\Custom\RegistrySYSTEM = %CDROM%\Custom\SystemRESTORE = D:\!Personal!\SystemBackupThis 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\\";andrs = 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?
March 29, 200521 yr Author I dont mean for this to sound offensive in any way, but didnt you design this or am I mistaken?
March 29, 200521 yr hasi and other people before him dit it. kelsenellenelvian is improving wpi on other parts than that.
March 29, 200521 yr Make sense? Makes perfect sense to me now, durex, but I'm no programmer. Maybe play with it, try it out, and post back...unless hasi001 or others have an idea?
March 29, 200521 yr 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.
May 20, 200521 yr I have created a System variable on the XP client like this:Variable = appsValue = \\dc01\appsAnd in the generate.js i added this:Under the function replpath(u) add: apps = WshEnv("apps") + "\\"; rs = rs.replace(/%apps%/gi, apps);Best regardsErling Johansen
Create an account or sign in to comment