durex Posted March 27, 2005 Share Posted March 27, 2005 What would be the best way to add additional variables to be used with WPI? Link to comment Share on other sites More sharing options...
durex Posted March 28, 2005 Author Share Posted March 28, 2005 is it even possible? Link to comment Share on other sites More sharing options...
blinkdt Posted March 28, 2005 Share Posted March 28, 2005 @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. Link to comment Share on other sites More sharing options...
durex Posted March 29, 2005 Author Share Posted March 29, 2005 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? Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted March 29, 2005 Share Posted March 29, 2005 Kind of an interesting concept m8.Beyond my skills though. Link to comment Share on other sites More sharing options...
durex Posted March 29, 2005 Author Share Posted March 29, 2005 I dont mean for this to sound offensive in any way, but didnt you design this or am I mistaken? Link to comment Share on other sites More sharing options...
djbe Posted March 29, 2005 Share Posted March 29, 2005 hasi and other people before him dit it. kelsenellenelvian is improving wpi on other parts than that. Link to comment Share on other sites More sharing options...
blinkdt Posted March 29, 2005 Share Posted March 29, 2005 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? Link to comment Share on other sites More sharing options...
Stalkie Posted March 29, 2005 Share Posted March 29, 2005 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. Link to comment Share on other sites More sharing options...
erlingpj Posted May 20, 2005 Share Posted May 20, 2005 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 Link to comment Share on other sites More sharing options...
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