[wpkg-users] uninstall wpkg?
Tomasz Chmielewski
mangoo at wpkg.org
Mon Mar 5 21:37:00 CET 2007
Marco Gaiarin schrieb:
> Mandi! Tomasz Chmielewski
> In chel di` si favelave...
>
>>> Speaking practically: i can wrap around 'Script file path' a batch
>>> file?
>> No, it has to be something "startable" by cscript.
>
> Ok, i've fired up the feature request. Please consider it.
>
>
> As a total .js ignorant: could keep this approach, eg, build a little
> .js script that check an environment variable and then call wpkg.js?
OK, let's practice some JScript - create a file called marco.js, with
contents:
// some needed stuff
var shell = new ActiveXObject("WScript.Shell");
var your_variable = shell.Environment("PROCESS");
// substitute "YOUR_CMD_VARIABLE" with the variable
// you used in cmd.exe
var simple = your_variable("YOUR_CMD_VARIABLE");
// our check
if (simple == "marco_learns_jscript")
{
WScript.Echo("Starting notepad " + simple + "...");
shell.exec("notepad " + simple);
} else {
WScript.Echo("Your variable was: " + simple);
}
Now, start cmd.exe, declare a variable, and start the code:
set YOUR_CMD_VARIABLE=jscript_is_hard_to_learn
cscript marco.js
Then, change the variable, and start the code again:
set YOUR_CMD_VARIABLE=marco_learns_jscript
cscript marco.js
Now that you're advanced in JScript, you can fixing old bugs :)
--
Tomasz Chmielewski
http://wpkg.org
_______________________________________________
wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users
More information about the wpkg-users
mailing list